-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
fix(core/dfn-panel): avoid using CSS variables #2888
Conversation
content: ""; | ||
position: absolute; | ||
border: 10px solid transparent; | ||
border-top: 0; | ||
border-bottom: 9px solid #a2a9b1; /* triangle outline */ | ||
top: -9px; | ||
left: calc(var(--caret-offset, 0px) + 0.75em); /* set via JS */ |
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.
Might be better to use attr()
in the future rather than just reverting this. Google just posted an intent to implement for the feature. https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/FGCgsKmylhw/BSUrk2roCQAJ
Since the validator is quite inactive, the browser implementation might be quicker.
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.
Looking at the code, the validator already supports attr()
so we probably can just use it when the browser support lands.
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.
Even though nuHTML allows advanced attr()
, CSS validator doesn't yet.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
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.
Hey, actually it does validate it!
.abc {
width: calc(attr(data-foo px) / 10);
}
Try this code.
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.
Oh right! I missed the px
suffix
Reverts hot-fix from https://github.com/w3c/respec/pull/2846 (See https://github.com/w3c/respec/issues/2845)
Precursor to https://github.com/w3c/respec/pull/2820
This changes the markup for dfnPanel, mainly converts the caret to a
<span>
instead of::before
as we cannot programmatically set position of::before
without CSS variables - which aren't supported by nuHTML validator.