aliases.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * Aliases are pseudos that are expressed as selectors.
  3. */
  4. export const aliases = {
  5. // Links
  6. "any-link": ":is(a, area, link)[href]",
  7. link: ":any-link:not(:visited)",
  8. // Forms
  9. // https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
  10. disabled: `:is(
  11. :is(button, input, select, textarea, optgroup, option)[disabled],
  12. optgroup[disabled] > option,
  13. fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
  14. )`,
  15. enabled: ":not(:disabled)",
  16. checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",
  17. required: ":is(input, select, textarea)[required]",
  18. optional: ":is(input, select, textarea):not([required])",
  19. // JQuery extensions
  20. // https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-selectedness
  21. selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",
  22. checkbox: "[type=checkbox]",
  23. file: "[type=file]",
  24. password: "[type=password]",
  25. radio: "[type=radio]",
  26. reset: "[type=reset]",
  27. image: "[type=image]",
  28. submit: "[type=submit]",
  29. parent: ":not(:empty)",
  30. header: ":is(h1, h2, h3, h4, h5, h6)",
  31. button: ":is(button, input[type=button])",
  32. input: ":is(input, textarea, select, button)",
  33. text: "input:is(:not([type!='']), [type=text])",
  34. };
  35. //# sourceMappingURL=aliases.js.map