variables-color.css

Same filename and directory in other branches
  1. 11.x core/themes/default_admin/css/_variables/variables-color.css

Color custom properties — the canonical `--admin-color-*` token API.

File

core/themes/default_admin/css/_variables/variables-color.css

View source
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/3084859
  5. * @preserve
  6. */
  7. /**
  8. * @file
  9. * Color custom properties — the canonical `--admin-color-*` token API.
  10. */
  11. :root {
  12. /*
  13. * Tier 1 (primitive colors).
  14. */
  15. --admin-color-white: white;
  16. --admin-color-gray-200-o-80: color-mix(in sRGB, rgb(212, 212, 218) 80%, transparent);
  17. /* Gray variations. */
  18. --admin-color-gray-950: #222330;
  19. --admin-color-gray-900: #393a3f;
  20. --admin-color-gray-800: #545560;
  21. --admin-color-gray-700: #767676;
  22. --admin-color-gray-600: #828388;
  23. --admin-color-gray-500: #8e929c;
  24. --admin-color-gray-400: #adaeb3;
  25. --admin-color-gray-300: #c2c2c2;
  26. --admin-color-gray-200: #d4d4d8;
  27. --admin-color-gray-100: #dedfe4;
  28. --admin-color-gray-050: #f3f4f9;
  29. --admin-color-gray-025: #f9faff;
  30. /* Blue variations. */
  31. --admin-color-blue-900: #000f33;
  32. --admin-color-blue-800: #001f66;
  33. --admin-color-blue-700: #002e9a;
  34. --admin-color-blue-650: #0036b1;
  35. --admin-color-blue-600: #003ecc;
  36. --admin-color-blue-500: #004eff;
  37. --admin-color-blue-400: #3371ff;
  38. --admin-color-blue-300: #6694ff;
  39. --admin-color-blue-200: #99b8ff;
  40. --admin-color-blue-100: #ccdbff;
  41. --admin-color-blue-070: #dbe6ff;
  42. --admin-color-blue-050: #e5edff;
  43. --admin-color-blue-020: #f5f8ff;
  44. /* Red variations. */
  45. --admin-color-red-900: #2c0707;
  46. --admin-color-red-800: #580e0e;
  47. --admin-color-red-700: #841515;
  48. --admin-color-red-600: #b01c1c;
  49. --admin-color-red-550: #c61f1f;
  50. --admin-color-red-500: #dc2323;
  51. --admin-color-red-400: #e34f4f;
  52. --admin-color-red-300: #ea7b7b;
  53. --admin-color-red-200: #f1a7a7;
  54. --admin-color-red-100: #f8d3d3;
  55. --admin-color-red-070: #fae0e0;
  56. --admin-color-red-050: #fce9e9;
  57. --admin-color-red-020: #fdf5f5;
  58. /*
  59. * Link / interactive blue. Used for links and blue focus/selected accents
  60. * (text, border, and bg).
  61. */
  62. /* @todo links don't use --admin-color-link. Need to refactor. */
  63. --admin-color-link: var(--admin-color-blue-600);
  64. --admin-color-link-hover: light-dark(var(--admin-color-blue-650), var(--admin-color-accent-700));
  65. --admin-color-link-active: var(--admin-color-blue-700);
  66. /*
  67. * Semantic tokens (tier 2). Mode-aware ones use light-dark().
  68. *
  69. * Composition: the LIGHT half references a primitive ramp step
  70. * wherever a step matches the in-use value — the ramp was reconciled TO these
  71. * semantics (primitives follow semantics), so this is value-preserving. The DARK
  72. * half stays a literal: the ramps are light-only, so there is no dark primitive
  73. * to point at. Tokens left fully literal are intentional —
  74. * either functional (color-mix() rings/hairlines), a bespoke value off the ramp
  75. * (the dark surfaces, status families, switch, icon), or a near-black distinct
  76. * from the ramp. Don't "fix" those into var() refs.
  77. */
  78. /*
  79. * Text. Contrast ladder is soft / (default) / loud.
  80. * --admin-color-text default body text.
  81. * --admin-color-text-soft lower-contrast / secondary text — labels, help,
  82. * descriptions. Quieter; recedes.
  83. * --admin-color-text-loud higher-contrast / emphasized text — headings, titles.
  84. * (--admin-color-text-on-primary, below, is text on a primary-colored fill.)
  85. */
  86. --admin-color-text: light-dark(var(--admin-color-gray-950), #d2d3d3);
  87. --admin-color-text-soft: light-dark(var(--admin-color-gray-800), #9e9fa0);
  88. --admin-color-text-loud: light-dark(var(--admin-color-gray-950), white);
  89. /*
  90. * Status — each family has three roles:
  91. * --admin-color-{status} solid — icons, borders, emphasis on a neutral bg.
  92. * --admin-color-bg-{status} the light tint behind highlighted rows / reports.
  93. * --admin-color-text-{status} text ON that tint (AA-verified pair).
  94. * Families: error · warning · success · info. (`danger` is retired.) Message
  95. * banners use their own dark-tinted palette, scoped in components/messages.pcss.css.
  96. */
  97. --admin-color-error: light-dark(#cc3d3d, #ce6060);
  98. --admin-color-bg-error: color-mix(in srgb, #de7560 15%, transparent);
  99. --admin-color-text-error: light-dark(#cc3d3d, #e69e9e);
  100. --admin-color-warning: light-dark(#d8b234, #dec15f);
  101. --admin-color-bg-warning: color-mix(in srgb, #e29700 15%, transparent);
  102. --admin-color-text-warning: light-dark(#826b1f, #e8d185);
  103. --admin-color-success: light-dark(#058260, #32cea4);
  104. --admin-color-bg-success: light-dark(#26a76930, #26a76940);
  105. --admin-color-text-success: light-dark(#1d6844, #8bd3b1);
  106. --admin-color-info: light-dark(#589ac5, #559bca);
  107. --admin-color-contextual: light-dark(var(--admin-color-text), var(--admin-color-bg-raised));
  108. /*
  109. * Surfaces — background ROLES, not an elevation ladder. In light mode several
  110. * resolve to the same white; "raising" or "sinking" a surface is expressed by
  111. * going lighter/darker relative to the canvas, and that direction inverts
  112. * between modes — hence light-dark(). Always pair a surface with
  113. * --admin-color-text (or -text-soft) and verify AA contrast in both modes.
  114. *
  115. * -surface default surface — cards, panes, tables, page chrome.
  116. * -surface-nested a surface recessed inside another surface (e.g. a panel
  117. * within a card; also the form-control fill in dark mode).
  118. * -raised floating ABOVE the page — dropdowns, tooltips, contextual
  119. * links, the sticky toolbar. The most "popped" surface
  120. * (lightest in dark mode).
  121. * -sunken an inset WELL — code blocks, recessed/embedded regions
  122. * (darker than the canvas in both modes).
  123. * -input form-control background.
  124. * -header table/section header tint and the sticky page header.
  125. *
  126. * The page canvas --admin-color-bg is defined in
  127. * css/_variables/variables-color-accent.pcss.css
  128. * (← --gin-bg-app): its light value is accent-derived (var(--app-bg-color)),
  129. * already mode-aware via that file's light-dark() bases.
  130. */
  131. --admin-color-bg-surface: light-dark(var(--admin-color-white), #2a2a2d);
  132. --admin-color-bg-surface-nested: light-dark(#edeff5, #3b3b3f);
  133. --admin-color-bg-raised: light-dark(var(--admin-color-white), #47474c);
  134. --admin-color-bg-sunken: light-dark(#e2e5ec, #19191b);
  135. --admin-color-bg-input: light-dark(var(--admin-color-white), #3b3b3f);
  136. --admin-color-bg-header: light-dark(#e1eafc, #1b1b1d);
  137. --admin-color-bg-unpublished: light-dark(var(--admin-color-bg-error), var(--admin-color-bg-warning));
  138. --admin-color-icon: light-dark(#414247, #888);
  139. /*
  140. * Borders. Contrast ladder soft / (default) / loud.
  141. * --admin-color-border default divider/edge — cards, panes, controls.
  142. * --admin-color-border-soft subtle/translucent hairline; also soft shadows.
  143. * --admin-color-border-loud strongest divider — table-header separators.
  144. * --admin-color-border-input form-control border.
  145. * --admin-color-border-table thin table row divider (soft in light, default
  146. * edge in dark).
  147. */
  148. --admin-color-border: light-dark(var(--admin-color-gray-200), #43454a);
  149. --admin-color-border-soft: light-dark(color-mix(in sRGB, black 8%, transparent), color-mix(in sRGB, black 5%, transparent));
  150. --admin-color-border-loud: light-dark(color-mix(in sRGB, black 30%, transparent), color-mix(in sRGB, white 40%, transparent));
  151. --admin-color-border-input: light-dark(var(--admin-color-gray-500), #76777b);
  152. --admin-color-border-table: light-dark(color-mix(in srgb, black 10%, transparent), #43454a);
  153. --admin-color-text-on-primary: light-dark(var(--admin-color-white), #111);
  154. --admin-color-switch: light-dark(#26a769, var(--admin-color-accent-100));
  155. /* @todo dark value was the invalid `rgba(#111, 0.9)` (no shadow rendered); kept
  156. as transparent to preserve behavior — fix to rgb(17 17 17 / 0.9) deliberately. */
  157. --admin-color-shadow-button: light-dark(#0003, transparent);
  158. --admin-color-bg-inverse: light-dark(var(--admin-color-gray-950), var(--admin-color-bg-raised));
  159. /*
  160. * Elevation shadows. The per-layer shadow colors are factored into
  161. * --admin-shadow-color-{1..4} utilities, numbered by elevation step (1 =
  162. * tightest/closest layer … 4 = deepest ambient). Each is a light/dark tint at
  163. * a fixed opacity (light is a blue-gray, dark is black). The --admin-shadow-*
  164. * composites below stack them.
  165. */
  166. --admin-shadow-color-1: light-dark(color-mix(in srgb, #142d52 2%, transparent), color-mix(in srgb, black 2%, transparent));
  167. --admin-shadow-color-2: light-dark(color-mix(in srgb, #142d52 3%, transparent), color-mix(in srgb, black 3%, transparent));
  168. --admin-shadow-color-3: light-dark(color-mix(in srgb, #142d52 4%, transparent), color-mix(in srgb, black 4%, transparent));
  169. --admin-shadow-color-4: light-dark(color-mix(in srgb, #142d52 12%, transparent), color-mix(in srgb, black 12%, transparent));
  170. --admin-shadow-1: 0 1px 2px var(--admin-shadow-color-1), 0 0.1875rem 0.25rem var(--admin-shadow-color-2), 0 0.3125rem 0.5rem var(--admin-shadow-color-3);
  171. --admin-shadow-2: 0 1px 2px var(--admin-shadow-color-1), 0 0.1875rem 0.25rem var(--admin-shadow-color-2), 0 0.3125rem 0.5rem var(--admin-shadow-color-3), 0 1.25rem 1.5rem var(--admin-shadow-color-4);
  172. /*
  173. * Focus & disabled.
  174. * --admin-color-focus focus-ring color.
  175. * --admin-color-focus-border inner focus-ring border.
  176. * --admin-color-focus-neutral neutral focus-ring variant ([data-gin-focus]).
  177. * --admin-color-text-disabled / -bg-disabled / -border-disabled disabled controls.
  178. */
  179. --admin-color-focus: light-dark(color-mix(in srgb, #007dfa 60%, transparent), #51a8ff);
  180. /* @todo this is used in box-shadow focus states, which will be phased out in favor of outline. */
  181. --admin-color-focus-border: light-dark(color-mix(in sRGB, black 20%, transparent), color-mix(in sRGB, black 80%, transparent));
  182. --admin-color-focus-neutral: light-dark(color-mix(in sRGB, black 40%, transparent), color-mix(in sRGB, white 80%, transparent));
  183. --admin-color-text-disabled: light-dark(var(--admin-color-gray-700), #919191);
  184. --admin-color-bg-disabled: light-dark(#eaeaea, #47474c);
  185. --admin-color-border-disabled: light-dark(var(--admin-color-gray-300), #646464);
  186. }
  187. @media (forced-colors: active) {
  188. :root {
  189. --admin-color-icon: CanvasText;
  190. }
  191. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.