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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃枍 [Story interactive] Adapt slider styles to work on Firefox #35432
Conversation
Hey @gmajoulet! These files were changed:
|
var(--interactive-accent-color) var(--percentage-corrected) | ||
) !important; | ||
opacity: 0.3 !important; | ||
z-index: 0 !important; | ||
} | ||
|
||
.i-amphtml-story-interactive-slider-input::-webkit-slider-thumb { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the .i-amphtml-story-interactive-slider-input::-moz-range-thumb
selector be added to this ruleset with the addition of border: none !important;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's sth about the selector that breaks when we specify the two rules in the same ruleset like a, b {}
. I think because Chrome doesn't know about the Firefox prefixes, it invalidates the ruleset. That's why we need 2 separate rulesets here.
More info at https://css-tricks.com/styling-cross-browser-compatible-range-inputs-css/
z-index: 2 !important; | ||
} | ||
|
||
.i-amphtml-story-interactive-mid-selection .i-amphtml-story-interactive-slider-input::-moz-range-thumb { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above, maybe this selector can be added to the .i-amphtml-story-interactive-mid-selection .i-amphtml-story-interactive-slider-input::-webkit-slider-thumb
ruleset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSS can be combined in a couple places but this looks good to me!
@processprocess does not work, since combining the rules will make both browsers fail to parse the selector. |
That's so crazy! Thanks for making the demo and explaining. |
Firefox renderer doesn't follow certain things that Chrome does:
z-index
for thumbs follow the input element's value.Demo: https://stories-demos-matias.web.app/examples/amp-story/interactive_slider.html