-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnecessary CSS is included in IE8 stylesheet #3231
Comments
I think there are a couple of things that are going on in our codebase that are worth pointing out as they are somewhat hidden / confusing:
We're using a vendored version of sass-mq under the hood – wherever you see the govuk-frontend/src/govuk/helpers/_media-queries.scss Lines 87 to 91 in 8620a4f
One of the features of sass-mq is that it 'rasterizes' media queries – so wherever govuk-frontend/src/govuk/vendor/_sass-mq.scss Lines 198 to 215 in 8620a4f
There's nothing intelligent going on to remove duplicates and – because this happens as part of the Sass compilation step – there's no media query left for We do have a few other places in the codebase where we use
To the best of my knowledge, we've never used govuk-frontend/src/govuk/helpers/_typography.scss Lines 150 to 153 in 8620a4f
There's a flag to enable this ( |
Closing as we're now starting work on GOV.UK Frontend 5, which drops support for IE8. |
Cause
Unnecessary CSS, such as repeated style rules and features that are not supported by Internet Explorer 8, is still being included in the IE8-specific stylesheet, despite efforts to automatically remove these features.
Noticed during the 4.5.0 release process.
Repeated rules
Rules are repeated in several places where media queries have been removed. postcss-unmq should be removing the duplicates and only including the rules relevant to the configured screen dimensions (by default, 1024×768)—however this doesn't appear to be happening.
The presence of both rem and px unit versions is due to node-pixrem. Having the rem unit versions is unnecessary in the IE8 stylesheet, too.
Unsupported rules
Unsupported CSS rules are still included, such as the flexbox-related rules here.
And
box-shadow
andbox-decoration-break
rules here:Unsupported selectors
Selectors incorporating the
:not
selector are included in the stylesheet, despite not being supported by IE8.Same for
:last-child
and:last-of-type
here.Unsupported functions
Several CSS functions not supported by IE8 are still included. In this example, none of
calc()
,env()
ormax()
are supported in IE8.Third-party browser prefixes
Some browser-prefixed properties and values are still included, despite not being relevant to IE8.
@supports
at-rule@supports
at-rules are included in the stylesheet, despite IE8 not supporting them.Consequences
We ship significantly more CSS to IE8 than the browser is capable of using. This may have an exacerbated effect on performance as any contemporary IE8 users are probably running very old hardware and software.
Impact of debt
Low
Reason
Considered as low because:
Effort to pay down
High
Reason
Some of these issues could be resolved manually by wrapping the offending code in the
govuk-not-ie8
mixin, so that it's not included in the IE8 stylesheet.For others: We currently use the Oldie plugin to automatically remove unsupported features in the IE8 stylesheet. Oldie appears to be unmaintained, with issues and pull requests not being monitored. We would likely have to fork the plugin or its dependencies if we wanted to make updates to how it works.
Despite us planning to drop support for IE8 going forward, we will still be supporting it on a security and major bugfix basis for at least a year following the release of Frontend v5. We may want to pay down some of this debt so that things are in a better place before we reduce and drop IE8 support completely.
Overall rating
Low
The text was updated successfully, but these errors were encountered: