elements.pcss.css

Same filename in other branches
  1. 8.9.x core/themes/claro/css/base/elements.pcss.css
  2. 10 core/themes/claro/css/base/elements.pcss.css
  3. 11.x core/themes/claro/css/base/elements.pcss.css
/**
 * Generic elements.
 */

@import "./variables.pcss.css";

html {
  font-family: var(--font-family);
  font-size: 100%;
  font-weight: normal;
  font-style: normal;
  line-height: var(--line-height);
}
body {
  color: var(--color-fg);
  background: var(--color-bg);
}

a,
.link {
  color: var(--color-link);
}
a:hover,
a:focus,
.link:hover,
.link:focus {
  text-decoration: none;
  outline: 0;
}
a:hover,
.link:hover {
  color: var(--color-link-hover);
}
a:active,
.link:active {
  color: var(--color-link-active);
}
hr {
  height: 1px;
  margin: var(--space-m) 0;
  padding: 0;
  border: none;
  background: var(--color-divider);
}

summary {
  font-weight: bold;
}

/**
 * Reusable heading classes are included to help modules change the styling of
 * headings on a page without affecting accessibility.
 */
h1,
.heading-a {
  margin: var(--space-m) 0 var(--space-s);
  font-size: var(--font-size-h1);
  font-weight: bold;
  line-height: var(--line-height-heading);
}
h2,
.heading-b {
  margin: var(--space-m) 0 var(--space-s);
  font-size: var(--font-size-h2);
  font-weight: bold;
  line-height: var(--line-height-heading);
}
h3,
.heading-c {
  margin: var(--space-m) 0 var(--space-s);
  font-size: var(--font-size-h3);
  font-weight: bold;
  line-height: var(--line-height-heading);
}
h4,
.heading-d {
  margin: var(--space-m) 0 var(--space-s);
  font-size: var(--font-size-h4);
  font-weight: bold;
  line-height: var(--line-height-heading);
}
h5,
.heading-e {
  margin: var(--space-m) 0 var(--space-s);
  font-size: var(--font-size-h5);
  font-weight: bold;
  line-height: var(--line-height-heading);
}
h6,
.heading-f {
  margin: var(--space-m) 0 var(--space-s);
  font-size: var(--font-size-h6);
  font-weight: bold;
  line-height: var(--line-height-heading);
}
p {
  margin: 1em 0;
}
dl {
  margin: 0 0 20px;
}
dl dd,
dl dl {
  margin-bottom: 10px;
  margin-left: 20px; /* LTR */
}
[dir="rtl"] dl dd,
[dir="rtl"] dl dl {
  margin-right: 20px;
}
blockquote {
  position: relative;
  margin: var(--space-l);
  margin-left: 2.5rem; /* LTR */
  font-size: var(--font-size-h6);
}
[dir="rtl"] blockquote {
  margin-right: 2.5rem;
}
blockquote::before {
  position: absolute;
  left: -2.5rem; /* LTR */
  content: open-quote;
  color: var(--color-absolutezero);
  font-family: var(--font-family-serif);
  font-size: var(--space-xl);
  line-height: 1em;
}
[dir="rtl"] blockquote::before {
  right: -2.5rem;
}
blockquote::after {
  content: no-close-quote;
}
address {
  font-style: italic;
}
u,
ins {
  text-decoration: underline;
}
s,
strike,
del {
  text-decoration: line-through;
}
big {
  font-size: larger;
}
small {
  font-size: smaller;
}
sub {
  vertical-align: sub;
  font-size: smaller;
  line-height: normal;
}
sup {
  vertical-align: super;
  font-size: smaller;
  line-height: normal;
}
abbr,
acronym {
  border-bottom: dotted 1px;
}
ul {
  margin: 0.25em 0 0.25em 1.5em; /* LTR */
  padding-left: 0;
  list-style-type: disc;
  list-style-image: none;
}
[dir="rtl"] ul {
  margin-right: 1.5em;
  margin-left: 0;
  padding-right: 0;
}
/* This is required to win over specificity of [dir="rtl"] ul */
[dir="rtl"] .messages__list {
  margin-right: 0;
}
ol {
  margin: 0.25em 0 0.25em 2em; /* LTR */
  padding: 0;
  list-style-type: decimal;
}
[dir="rtl"] ol {
  margin-right: 2em;
  margin-left: 0;
}

/**
 * Fix duplicate border caused by normalize.css adding border-bottom without
 * removing the text-decoration.
 */
abbr[title] {
  text-decoration: none;
}

code {
  margin: 0.5em 0;
}
pre {
  margin: 0.5em 0;
  white-space: pre-wrap;
}
details {
  line-height: var(--details-line-height);
}
details summary {
  padding: 0.95em 1.45em;
}
details summary:focus {
  outline: none;
}
img {
  max-width: 100%;
  height: auto;
}

/**
 * Default focus styles for focused elements.
 *
 * This is applied globally to all interactive elements except Toolbar and
 * Settings Tray since they have their own styles.
 *
 * @todo https://www.drupal.org/project/claro/issues/3048785 :focus selector is
 *   active for non-interactive elements in Internet Explorer 11.
 */
.page-wrapper *:focus,
.ui-dialog *:focus {
  outline: var(--focus-outline);
  box-shadow: var(--focus-box-shadow);
}

File

core/themes/claro/css/base/elements.pcss.css

View source
  1. /**
  2. * Generic elements.
  3. */
  4. @import "./variables.pcss.css";
  5. html {
  6. font-family: var(--font-family);
  7. font-size: 100%;
  8. font-weight: normal;
  9. font-style: normal;
  10. line-height: var(--line-height);
  11. }
  12. body {
  13. color: var(--color-fg);
  14. background: var(--color-bg);
  15. }
  16. a,
  17. .link {
  18. color: var(--color-link);
  19. }
  20. a:hover,
  21. a:focus,
  22. .link:hover,
  23. .link:focus {
  24. text-decoration: none;
  25. outline: 0;
  26. }
  27. a:hover,
  28. .link:hover {
  29. color: var(--color-link-hover);
  30. }
  31. a:active,
  32. .link:active {
  33. color: var(--color-link-active);
  34. }
  35. hr {
  36. height: 1px;
  37. margin: var(--space-m) 0;
  38. padding: 0;
  39. border: none;
  40. background: var(--color-divider);
  41. }
  42. summary {
  43. font-weight: bold;
  44. }
  45. /**
  46. * Reusable heading classes are included to help modules change the styling of
  47. * headings on a page without affecting accessibility.
  48. */
  49. h1,
  50. .heading-a {
  51. margin: var(--space-m) 0 var(--space-s);
  52. font-size: var(--font-size-h1);
  53. font-weight: bold;
  54. line-height: var(--line-height-heading);
  55. }
  56. h2,
  57. .heading-b {
  58. margin: var(--space-m) 0 var(--space-s);
  59. font-size: var(--font-size-h2);
  60. font-weight: bold;
  61. line-height: var(--line-height-heading);
  62. }
  63. h3,
  64. .heading-c {
  65. margin: var(--space-m) 0 var(--space-s);
  66. font-size: var(--font-size-h3);
  67. font-weight: bold;
  68. line-height: var(--line-height-heading);
  69. }
  70. h4,
  71. .heading-d {
  72. margin: var(--space-m) 0 var(--space-s);
  73. font-size: var(--font-size-h4);
  74. font-weight: bold;
  75. line-height: var(--line-height-heading);
  76. }
  77. h5,
  78. .heading-e {
  79. margin: var(--space-m) 0 var(--space-s);
  80. font-size: var(--font-size-h5);
  81. font-weight: bold;
  82. line-height: var(--line-height-heading);
  83. }
  84. h6,
  85. .heading-f {
  86. margin: var(--space-m) 0 var(--space-s);
  87. font-size: var(--font-size-h6);
  88. font-weight: bold;
  89. line-height: var(--line-height-heading);
  90. }
  91. p {
  92. margin: 1em 0;
  93. }
  94. dl {
  95. margin: 0 0 20px;
  96. }
  97. dl dd,
  98. dl dl {
  99. margin-bottom: 10px;
  100. margin-left: 20px; /* LTR */
  101. }
  102. [dir="rtl"] dl dd,
  103. [dir="rtl"] dl dl {
  104. margin-right: 20px;
  105. }
  106. blockquote {
  107. position: relative;
  108. margin: var(--space-l);
  109. margin-left: 2.5rem; /* LTR */
  110. font-size: var(--font-size-h6);
  111. }
  112. [dir="rtl"] blockquote {
  113. margin-right: 2.5rem;
  114. }
  115. blockquote::before {
  116. position: absolute;
  117. left: -2.5rem; /* LTR */
  118. content: open-quote;
  119. color: var(--color-absolutezero);
  120. font-family: var(--font-family-serif);
  121. font-size: var(--space-xl);
  122. line-height: 1em;
  123. }
  124. [dir="rtl"] blockquote::before {
  125. right: -2.5rem;
  126. }
  127. blockquote::after {
  128. content: no-close-quote;
  129. }
  130. address {
  131. font-style: italic;
  132. }
  133. u,
  134. ins {
  135. text-decoration: underline;
  136. }
  137. s,
  138. strike,
  139. del {
  140. text-decoration: line-through;
  141. }
  142. big {
  143. font-size: larger;
  144. }
  145. small {
  146. font-size: smaller;
  147. }
  148. sub {
  149. vertical-align: sub;
  150. font-size: smaller;
  151. line-height: normal;
  152. }
  153. sup {
  154. vertical-align: super;
  155. font-size: smaller;
  156. line-height: normal;
  157. }
  158. abbr,
  159. acronym {
  160. border-bottom: dotted 1px;
  161. }
  162. ul {
  163. margin: 0.25em 0 0.25em 1.5em; /* LTR */
  164. padding-left: 0;
  165. list-style-type: disc;
  166. list-style-image: none;
  167. }
  168. [dir="rtl"] ul {
  169. margin-right: 1.5em;
  170. margin-left: 0;
  171. padding-right: 0;
  172. }
  173. /* This is required to win over specificity of [dir="rtl"] ul */
  174. [dir="rtl"] .messages__list {
  175. margin-right: 0;
  176. }
  177. ol {
  178. margin: 0.25em 0 0.25em 2em; /* LTR */
  179. padding: 0;
  180. list-style-type: decimal;
  181. }
  182. [dir="rtl"] ol {
  183. margin-right: 2em;
  184. margin-left: 0;
  185. }
  186. /**
  187. * Fix duplicate border caused by normalize.css adding border-bottom without
  188. * removing the text-decoration.
  189. */
  190. abbr[title] {
  191. text-decoration: none;
  192. }
  193. code {
  194. margin: 0.5em 0;
  195. }
  196. pre {
  197. margin: 0.5em 0;
  198. white-space: pre-wrap;
  199. }
  200. details {
  201. line-height: var(--details-line-height);
  202. }
  203. details summary {
  204. padding: 0.95em 1.45em;
  205. }
  206. details summary:focus {
  207. outline: none;
  208. }
  209. img {
  210. max-width: 100%;
  211. height: auto;
  212. }
  213. /**
  214. * Default focus styles for focused elements.
  215. *
  216. * This is applied globally to all interactive elements except Toolbar and
  217. * Settings Tray since they have their own styles.
  218. *
  219. * @todo https://www.drupal.org/project/claro/issues/3048785 :focus selector is
  220. * active for non-interactive elements in Internet Explorer 11.
  221. */
  222. .page-wrapper *:focus,
  223. .ui-dialog *:focus {
  224. outline: var(--focus-outline);
  225. box-shadow: var(--focus-box-shadow);
  226. }

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