details.pcss.css

Same filename in this branch
  1. 10 core/misc/dialog/off-canvas/css/details.pcss.css
  2. 10 core/themes/claro/css/components/details.pcss.css
Same filename in other branches
  1. 9 core/themes/olivero/css/components/details.pcss.css
  2. 9 core/themes/claro/css/components/details.pcss.css
  3. 8.9.x core/themes/claro/css/components/details.pcss.css
  4. 11.x core/misc/dialog/off-canvas/css/details.pcss.css
  5. 11.x core/themes/olivero/css/components/details.pcss.css
  6. 11.x core/themes/claro/css/components/details.pcss.css

Collapsible details.

File

core/themes/olivero/css/components/details.pcss.css

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

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