@atlaskit/eslint-plugin-ui-styling-standard
Version:
The eslint plugin to enforce and educate on Atlassian's UI Styling Standard
23 lines (21 loc) • 1.91 kB
JavaScript
/**
* Validation approach from
* https://stackoverflow.com/a/71236280
*/
/**
* Exporting this so it isn't considered unused.
*/
var cssPseudos = ['&:active', '&:autofill', '&:blank', '&:checked', '&:default', '&:defined', '&:disabled', '&:empty', '&:enabled', '&:first', '&:focus', '&:focus-visible', '&:focus-within', '&:fullscreen', '&:hover', '&:in-range', '&:indeterminate', '&:invalid', '&:left', '&:link', '&:local-link', '&:optional', '&:out-of-range', '&:paused', '&:picture-in-picture', '&:placeholder-shown', '&:playing', '&:popover-open', '&:read-only', '&:read-write', '&:required', '&:right', '&:target', '&:user-invalid', '&:user-valid', '&:valid', '&:visited', '&::after', '&::backdrop', '&::before', '&::cue', '&::cue-region', '&::first-letter', '&::first-line', '&::grammar-error', '&::marker', '&::placeholder', '&::selection', '&::spelling-error', '&::target-text', '&::view-transition', '&::-webkit-details-marker',
// Chained pseudos (CSSFlattenedChainedPsuedos from @compiled/react)
'&:active:visited', '&:focus:not(:focus-visible)', '&:focus::after', '&:focus::before', '&:focus-visible::after', '&:focus-visible::before', '&:focus-within::after', '&:focus-within::before', '&:hover::after', '&:hover::before', '&:visited:active', '&:visited:hover', '&:visited:focus', '&:visited:focus-visible', '&:visited:focus-within',
// Vendor pseudo-elements with no standard equivalent. These are not part of CSSPseudos, so the
// typed @atlaskit/css and xcss APIs still reject them.
'&::-moz-focus-inner', '&::-moz-focus-outer', '&::-moz-range-progress', '&::-moz-range-thumb', '&::-moz-range-track', '&::-webkit-slider-runnable-track', '&::-webkit-slider-thumb'];
export var allowedPseudos = new Set(
/**
* The `&` is included above for type checking reasons,
* but we don't actually want it when consuming the values.
*/
cssPseudos.map(function (pseudo) {
return pseudo.slice(1);
}));