details.css

Same filename in this branch
  1. 10 core/profiles/demo_umami/themes/umami/css/classy/components/details.css
  2. 10 core/misc/dialog/off-canvas/css/details.css
  3. 10 core/themes/claro/css/components/details.css
  4. 10 core/themes/starterkit_theme/css/components/details.css
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/css/classy/components/details.css
  2. 9 core/themes/olivero/css/components/details.css
  3. 9 core/themes/seven/css/components/details.css
  4. 9 core/themes/claro/css/components/details.css
  5. 9 core/themes/bartik/css/classy/components/details.css
  6. 9 core/themes/starterkit_theme/css/components/details.css
  7. 9 core/themes/classy/css/components/details.css
  8. 8.9.x core/profiles/demo_umami/themes/umami/css/classy/components/details.css
  9. 8.9.x core/themes/seven/css/components/details.css
  10. 8.9.x core/themes/claro/css/components/details.css
  11. 8.9.x core/themes/bartik/css/classy/components/details.css
  12. 8.9.x core/themes/classy/css/components/details.css
  13. 11.x core/profiles/demo_umami/themes/umami/css/classy/components/details.css
  14. 11.x core/misc/dialog/off-canvas/css/details.css
  15. 11.x core/themes/olivero/css/components/details.css
  16. 11.x core/themes/claro/css/components/details.css
  17. 11.x core/themes/starterkit_theme/css/components/details.css

Collapsible details.

File

core/themes/olivero/css/components/details.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. * Collapsible details.
  10. */
  11. :root {
  12. --details-border-width: 1px;
  13. --details-summary-transition: background-color 0.12s ease-in-out;
  14. }
  15. .olivero-details {
  16. display: block;
  17. margin-block: var(--sp1);
  18. color: inherit;
  19. border: var(--details-border-width) solid var(--color--gray-95);
  20. border-radius: var(--border-radius);
  21. box-shadow: 0 1px 4px var(--color--gray-90);
  22. }
  23. /* Details summary styles */
  24. .olivero-details__summary {
  25. position: relative;
  26. padding-block: var(--sp1);
  27. padding-inline-start: var(--sp2);
  28. padding-inline-end: var(--sp1);
  29. list-style: none;
  30. cursor: pointer;
  31. transition: var(--details-summary-transition);
  32. word-wrap: break-word;
  33. hyphens: auto;
  34. color: inherit;
  35. background-color: var(--color--gray-100);
  36. font-size: var(--line-height-s);
  37. font-weight: 700;
  38. line-height: var(--sp1);
  39. }
  40. /* Arrow icon */
  41. .olivero-details__summary::before {
  42. position: absolute;
  43. inset-block-start: 50%;
  44. inset-inline-start: var(--sp0-75);
  45. display: block;
  46. width: 0.625rem;
  47. height: 0.625rem;
  48. content: "";
  49. transform: translateY(-50%) rotate(45deg); /* LTR */
  50. border-top: solid 2px currentColor;
  51. border-right: solid 2px currentColor;
  52. }
  53. [dir="rtl"] .olivero-details__summary::before {
  54. transform: translateY(-50%) rotate(-135deg);
  55. }
  56. /* Pseudo-selector to manage focus styles */
  57. .olivero-details__summary::after {
  58. position: absolute;
  59. inset: calc(var(--details-border-width) * -1);
  60. content: "";
  61. pointer-events: none;
  62. opacity: 0;
  63. border-radius: var(--border-radius);
  64. box-shadow: inset 0 0 0 2px var(--color--primary-60);
  65. }
  66. /* Hide the marker */
  67. .olivero-details__summary::-webkit-details-marker {
  68. display: none;
  69. }
  70. /* Disable default outline for summary, since we have own implementation */
  71. .olivero-details__summary:focus {
  72. outline: solid 2px transparent;
  73. outline-offset: -4px;
  74. }
  75. /* Details summary, hover state */
  76. .olivero-details__summary:hover {
  77. background-color: var(--color--gray-95);
  78. }
  79. /* Details summary, focus and active states */
  80. .olivero-details__summary:focus::after,
  81. .olivero-details__summary:active::after {
  82. opacity: 1;
  83. }
  84. /* Rotate arrow icon of the details summary, when details expanded */
  85. .olivero-details[open] > .olivero-details__summary::before {
  86. margin-block-start: -2px;
  87. transform: translateY(-50%) rotate(135deg);
  88. }
  89. /* Details content wrapper */
  90. .olivero-details__wrapper {
  91. margin: var(--sp1);
  92. }
  93. @media (min-width: 62.5rem) {
  94. .olivero-details__wrapper {
  95. margin-block-start: var(--sp1-5);
  96. margin-block-end: var(--sp1-5);
  97. margin-inline-start: var(--sp2);
  98. margin-inline-end: var(--sp2);
  99. }
  100. }
  101. /* Description */
  102. .olivero-details__description {
  103. margin-block-end: var(--sp1);
  104. color: var(--color-text-neutral-medium);
  105. font-size: var(--font-size-xs);
  106. line-height: var(--line-height-s);
  107. }

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