-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Allow !important
qualifiers in style[amp-noscript]
#36051
Comments
@westonruter for So |
@westonruter I have no issues with adding Do you want to create the PR or shall I? |
@Gregable Great! Would you please? |
I agree, amp-toolbox-php (https://github.com/ampproject/amp-toolbox-php) fails in ssr transformation due to !important restrictions. All pages stop validating. Any news about this?. Thanks. |
I implemented this back in January, the issue was just never closed. @jcastilloa you are probably running into issues around using |
Description
This is a follow-up to #20609.
In order to ensure that
amp-accordion
sections are initially-expanded on a page in which the user has JS turned off, the following is needed:Example: https://bento-amp-noscript-styles.glitch.me/
See: #20609 (comment)
The
!important
is needed here in order to override this!important
style fromampshared.css
:amphtml/css/ampshared.css
Lines 567 to 570 in 22ff7ae
However, this is not currently feasible since the use of
!important
qualifiers is not allowed instyle[amp-noscript]
:I propose that they be allowed in the same way they are allowed in
style[amp-runtime]
.Interestingly,
allow_important: true
doesn't appear instyle[amp-runtime]
:amphtml/validator/validator-css.protoascii
Lines 1317 to 1339 in 22ff7ae
Just as it doesn't appear in
style[amp-noscript]
:amphtml/validator/validator-css.protoascii
Lines 1341 to 1448 in 22ff7ae
Perhaps
allow_important
is only considered for rules that areenabled_by: "transformed"
?Alternatives Considered
None.
Additional Context
No response
The text was updated successfully, but these errors were encountered: