_title.scss 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Styles for title fields throughout the page.
  2. // The `title` class is meant to be applied by end users throughout different forms APIs.
  3. .w-panel.title,
  4. .w-field.title {
  5. input,
  6. textarea,
  7. .Draftail-Editor .public-DraftEditor-content {
  8. @apply w-h2;
  9. color: $color-input-text;
  10. }
  11. }
  12. // Styles for the title field when at the top of the page.
  13. // It’s the first panel when comments are disabled, second if enabled.
  14. .w-panel.title:nth-child(1),
  15. .w-panel.title:nth-child(2) {
  16. .w-panel__header {
  17. @apply w-sr-only;
  18. .w-panel__anchor,
  19. .w-panel__toggle {
  20. @apply w-hidden;
  21. }
  22. }
  23. .w-field {
  24. display: grid;
  25. }
  26. // Force the help text after the field as the field also visually acts as page heading.
  27. .w-field__help {
  28. order: 2;
  29. }
  30. input,
  31. textarea,
  32. .Draftail-Editor .public-DraftEditor-content {
  33. @apply w-h1;
  34. color: $color-input-text;
  35. // Slightly out-dented so the field’s is horizontally aligned.
  36. padding-inline-start: theme('spacing[1.5]');
  37. margin-inline-start: calc(-1 * theme('spacing[1.5]'));
  38. // Avoid calling attention to the field _unless_ it’s in one of those states.
  39. &:not(:hover, :focus, :placeholder-shown, [aria-invalid='true']) {
  40. // Hide w/ transparency to preserve border size and show it in forced-colors mode.
  41. border-color: transparent;
  42. }
  43. }
  44. }