-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More test around text decoration styling (#2327)
* Feature detect for text-decoration styling * Take PR from @stefanpl and merge it with test for text-decoration-skip-ink
- Loading branch information
Showing
2 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,41 @@ | ||
/*! | ||
{ | ||
"name": "CSS textDecoration", | ||
"property": "skipink", | ||
"tags": ["css"] | ||
"property": "textdecoration", | ||
"caniuse": "text-decoration", | ||
"tags": ["css"], | ||
"notes": [{ | ||
"name" : "w3c explanation of individual text-decoration properties", | ||
"href": "https://www.w3.org/TR/css-text-decor-3/#line-decoration" | ||
}] | ||
} | ||
!*/ | ||
define(['Modernizr', 'testProp'], function(Modernizr, testProp) { | ||
Modernizr.addTest('skipInk', testProp('textDecorationSkipInk', 'auto')); | ||
define(['Modernizr', 'testAllProps'], function(Modernizr, testAllProps) { | ||
|
||
(function() { | ||
|
||
Modernizr.addTest('textdecoration', function() { | ||
var bool = false; | ||
var test = testAllProps('textDecoration'); | ||
try { | ||
bool = !!test; | ||
if (bool) { | ||
bool = new Boolean(bool); | ||
} | ||
} catch (e) {} | ||
|
||
return bool; | ||
}); | ||
|
||
var props = ['Line', 'Style', 'Color', 'Skip', 'SkipInk']; | ||
var name, test; | ||
|
||
for (var i = 0; i < props.length; i++) { | ||
name = props[i].toLowerCase(); | ||
test = testAllProps('textDecoration' + props[i]); | ||
|
||
Modernizr.addTest('textdecoration.' + name, test); | ||
} | ||
})(); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters