variables-spacing.css

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

Spacing & layout-dimension custom properties.

The canonical --admin-space-* scale, the density-aware --admin-space-density-* scale ([data-gin-layout-density]), and layout dimensions/offsets (toolbar, sidebar, sticky). Consolidated from the former --space-* / --gin-spacing-* / --gin-spacing-density-* systems as part of https://www.drupal.org/i/3582351. The theme is alpha; the old token names are removed outright with no deprecation aliases.

Values are authored in px; the build's px-to-rem step converts them.

File

core/themes/default_admin/css/_variables/variables-spacing.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. * Spacing & layout-dimension custom properties.
  10. *
  11. * The canonical --admin-space-* scale, the density-aware --admin-space-density-*
  12. * scale ([data-gin-layout-density]), and layout dimensions/offsets (toolbar,
  13. * sidebar, sticky). Consolidated from the former --space-* / --gin-spacing-* /
  14. * --gin-spacing-density-* systems as part of
  15. * https://www.drupal.org/i/3582351. The theme is alpha; the old token
  16. * names are removed outright with no deprecation aliases.
  17. *
  18. * Values are authored in px; the build's px-to-rem step converts them.
  19. */
  20. :root {
  21. /**
  22. * Spacing scale.
  23. */
  24. --admin-space-3xs: 2px;
  25. --admin-space-2xs: 0.25rem;
  26. --admin-space-xs: 0.5rem;
  27. --admin-space-s: 0.75rem;
  28. --admin-space-m: 1rem;
  29. --admin-space-l: 1.5rem;
  30. --admin-space-xl: 2rem;
  31. --admin-space-2xl: 3rem;
  32. --admin-space-3xl: 4rem;
  33. /*
  34. * Layout dimensions & offsets.
  35. *
  36. * Namespaced --admin-theme-* (not --admin-toolbar-*) on purpose: core's
  37. * navigation / admin_toolbar module already owns the --admin-toolbar-* token
  38. * family (--admin-toolbar-color-*, --admin-toolbar-sidebar-width, …). These
  39. * are *this theme's* layout-geometry tokens, so they get their own
  40. * --admin-theme-* namespace to keep ownership unambiguous in the public API.
  41. *
  42. * --admin-theme-sidebar-width is written by the theme's JS at runtime
  43. * (migration/js/init.js, sidebar.js); the toolbar offsets derive in CSS from
  44. * core's --drupal-displace-offset-* (see navigation.pcss.css). Values declared
  45. * here are only the initial/fallback.
  46. */
  47. --admin-theme-height-sticky: 3.75rem;
  48. --admin-theme-toolbar-height: 0px;
  49. --admin-theme-toolbar-secondary-height: 0px;
  50. --admin-theme-toolbar-y-offset: 0px;
  51. --admin-theme-toolbar-x-offset: 0px;
  52. --admin-theme-scroll-offset: 0px;
  53. --admin-theme-sticky-offset: 0px;
  54. --admin-theme-sidebar-small-width: 20rem;
  55. --admin-theme-sidebar-min-width: 15rem;
  56. --admin-theme-sidebar-width: 20rem;
  57. --admin-theme-sidebar-max-width: 35rem;
  58. --admin-theme-sidebar-offset: var(--admin-theme-sidebar-width);
  59. @media (min-width: 64em) {
  60. --admin-theme-sticky-offset: var(--admin-theme-height-sticky);
  61. }
  62. @media (min-width: 80em) {
  63. --admin-theme-sidebar-width: 22.5rem;
  64. }
  65. }
  66. /**
  67. * Density-aware spacing scale.
  68. *
  69. * The [data-gin-layout-density] attribute re-declares this scale; the static
  70. * --admin-space-* scale above is intentionally NOT density-aware.
  71. */
  72. :root {
  73. --admin-space-density-2xs: 0.25rem;
  74. --admin-space-density-xs: 0.5rem;
  75. --admin-space-density-s: 0.75rem;
  76. --admin-space-density-m: 1rem;
  77. --admin-space-density-l: 1.5rem;
  78. --admin-space-density-xl: 2rem;
  79. --admin-space-density-2xl: 3rem;
  80. --admin-space-density-3xl: 4rem;
  81. &[data-gin-layout-density="small"] {
  82. --admin-space-density-2xs: 0.15625rem; /* 2.5px — authored in rem: below the build's 3px px-to-rem floor. */
  83. --admin-space-density-xs: 0.3125rem;
  84. --admin-space-density-s: 0.46875rem;
  85. --admin-space-density-m: 0.625rem;
  86. --admin-space-density-l: 0.9375rem;
  87. --admin-space-density-xl: 1.25rem;
  88. --admin-space-density-2xl: 1.875rem;
  89. --admin-space-density-3xl: 2.5rem;
  90. }
  91. &[data-gin-layout-density="medium"] {
  92. --admin-space-density-2xs: 0.1875rem;
  93. --admin-space-density-xs: 0.375rem;
  94. --admin-space-density-s: 0.5625rem;
  95. --admin-space-density-m: 0.75rem;
  96. --admin-space-density-l: 1.125rem;
  97. --admin-space-density-xl: 1.5rem;
  98. --admin-space-density-2xl: 2.25rem;
  99. --admin-space-density-3xl: 3rem;
  100. }
  101. }

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