You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this overloading will not work if used the custom color scheme through class: invert. CSS specificity of section.invert (0-1-1) is higher than section (0-0-1) so its style is always overloaded.
---theme: exampleclass: invert---
<style>
/* Not working */section {
background: yellow;
color: red;
}
</style>
This behavior may bring confusion of user who expected to overload styles.
By using :where() pseudo-selector to apply classes, built-in themes will allow simple overloading via section selector and reduce users stressful. :where() always has 0 specificity so styles in section:where(.invert) (0-0-1) can overload through section selector.
Let's consider the following example, covering
invert
color scheme class.If user thought to override colors through inline
<style>
in Markdown, a below Markdown will work correctly:However, this overloading will not work if used the custom color scheme through
class: invert
. CSS specificity ofsection.invert
(0-1-1) is higher thansection
(0-0-1) so its style is always overloaded.This behavior may bring confusion of user who expected to overload styles.
By using
:where()
pseudo-selector to apply classes, built-in themes will allow simple overloading viasection
selector and reduce users stressful.:where()
always has 0 specificity so styles insection:where(.invert)
(0-0-1) can overload throughsection
selector.The text was updated successfully, but these errors were encountered: