Closed hyrious closed 1 year ago
When generating, I noticed that it now includes some things we don't want, like [data-dev-analytics-enabled]
. Would you be able to remove that?
I'd like to, looks like these unwanted styles are extracted from top level rules (since they may have chance to affect markdown body).
Previously we only have one forbidden rule [hidden][hidden]
, maybe it's time to disallow more selectors.
Let's print out these selectors to have a glance (omitting '.class', ':root', '::-webkit-whatever', 'p'..):
[data-color-mode=light][data-light-theme*=light]
[data-color-mode=dark][data-dark-theme*=light]
[data-color-mode=light][data-light-theme*=dark]
[data-color-mode=dark][data-dark-theme*=dark]
[data-color-mode]
[hidden]
[type=reset]
[type=submit]
[type=checkbox]
[type=radio]
[type=number]::-webkit-inner-spin-button
[type=number]::-webkit-outer-spin-button
[type=search]::-webkit-search-cancel-button
[type=search]::-webkit-search-decoration
[role=button]:focus
[role=button]:focus:not(:focus-visible)
[role=button]:focus-visible
[data-catalyst]
[data-catalyst-inline]
[data-a11y-animated-images=system] [data-animated-image]
[data-a11y-animated-images=disabled] [data-animated-image]
[data-color-mode=light][data-light-theme*=dark] ::selection
[data-color-mode=dark][data-dark-theme*=dark] ::selection
[data-dev-analytics-enabled] [data-feeds-analytics]
[data-dev-analytics-enabled] [data-feeds-analytics]::after
[data-dev-analytics-enabled] [data-feeds-analytics]:hover
[data-dev-analytics-enabled] [data-feeds-analytics]:hover::after
maybe it's time to disallow more selectors.
👍
There are 2 issues in previous code:
Applying CSS variables wrongly handled non-exist variables, resulting
undefined
at value. It should be left as is.GitHub added 2 new CSS variables with default fallback, previously the script does not handle this case well, it can correctly extract them now.