Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In #1252178-81: Add Modernizr to core we had a request to add boxshadow
to Modernizr so that the default admin theme could safely replace outline:none
with box-shadow
. I'm not certain of the accessibility implications, but to avoid using that old issue for constant updates of the library, I've opened a new issue.
Patch incoming.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1987346-1-modernizr-boxshadow.patch | 11.17 KB | rupl |
Comments
Comment #1
ruplThis patch adds
boxshadow
test, and it adds two new internal "utilities" that Modernizr requires in order to test CSS:testAllProps
andtestProps
. They weren't required before because this is the first CSS test we're including in our build of Modernizr.There are some whitespace changes but no other substantive changes are being introduced. The overall library version remains at 2.6.2, and no existing tests have received upstream updates.
I haven't actually tested this patch because I'm getting some insane PHP error that is totally beyond my comprehension when I load up my test D8 site. I'm pretty confident that this patch is clean, but it should be reviewed by someone who can install HEAD trouble-free.
Comment #2
ry5n CreditAttribution: ry5n commentedI’m not used to scrutinizing Modernizr internals, but I tested this against the latest 8.x HEAD and the appropriate boxshadow class is added.
Comment #3
seutje CreditAttribution: seutje commentedI agree we need testProps and testPropsAll in our core build, but I'm not sure we want to invoke this test without a good reason for it.
The use-case outlined in #1252178-81: Add Modernizr to core is only for Seven, so wouldn't it be silly to penalize all those anonymous users for something that's required only in the administrative side of things?
There's also some weird indentation going on in there, but I assume that's from the build tool.
Comment #4
ry5n CreditAttribution: ry5n commented@seutje Yeah. It makes sense to move this test into Seven.
Comment #5
ruplagreed about boxshadow. I threw this together before seeing @jessebeach's comment. Will re-roll w/o
boxshadow
and leave Seven to implementModernizr.addTest
.yes, build tool is the cause of the whitespace weirdness. better not to fix it for now, and besides we will remove un-minified lib before shipping D8
Comment #6
nod_I'd say no to adding the test, even for Seven.
We don't use the prefixed version of box-shadow (required for older android browser versions). And the only other one that don't have support for it is IE8 (and opera mini but it has it's own thing to show focus and all). http://caniuse.com/css-boxshadow
Soooo, there you go.
Comment #7
ruplI can see what you mean, and I also was unsure if replacing
outline
withbox-shadow
was accessible. Closed.Comment #8
ry5n CreditAttribution: ry5n commentedI beg to differ; I think there is an a11y issue here. IE8 doesn’t support box-shadow, but it will respect 'outline: none'. Without a modernizr class, the following CSS (proposed for Seven) will cause IE8 to display no native focus indicator and no custom one either. The border color will change, but for some buttons (blue) this will not be visible enough. If no box-shadow, I want to defer to the browser style.
Comment #9
nod_CSS tests are expensive on the computational side of things. It'll be a huge performance impact on the long run.
I'd be fine if the test is in conditional comments (the irony). But not for everyone.
Just restore the outline on IE8, conditional comments are supported in core.
Comment #10
ry5n CreditAttribution: ry5n commented_nod OK, that works for me, although I’ll probably use conditional classes (add .lt-ie9 conditionally) instead of loading any JS.
Comment #10.0
ry5n CreditAttribution: ry5n commentedUpdated issue summary to include old issue number.