elements.pcss.css

Same filename in other branches
  1. 9 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 {
  margin: 1em 40px;
}
address {
  font-style: italic;
}
u,
ins {
  text-decoration: none;
}
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: 1.295em;
}
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. margin: 1em 40px;
  108. }
  109. address {
  110. font-style: italic;
  111. }
  112. u,
  113. ins {
  114. text-decoration: none;
  115. }
  116. s,
  117. strike,
  118. del {
  119. text-decoration: line-through;
  120. }
  121. big {
  122. font-size: larger;
  123. }
  124. small {
  125. font-size: smaller;
  126. }
  127. sub {
  128. vertical-align: sub;
  129. font-size: smaller;
  130. line-height: normal;
  131. }
  132. sup {
  133. vertical-align: super;
  134. font-size: smaller;
  135. line-height: normal;
  136. }
  137. abbr,
  138. acronym {
  139. border-bottom: dotted 1px;
  140. }
  141. ul {
  142. margin: 0.25em 0 0.25em 1.5em; /* LTR */
  143. padding-left: 0;
  144. list-style-type: disc;
  145. list-style-image: none;
  146. }
  147. [dir="rtl"] ul {
  148. margin-right: 1.5em;
  149. margin-left: 0;
  150. padding-right: 0;
  151. }
  152. /* This is required to win over specificity of [dir="rtl"] ul */
  153. [dir="rtl"] .messages__list {
  154. margin-right: 0;
  155. }
  156. ol {
  157. margin: 0.25em 0 0.25em 2em; /* LTR */
  158. padding: 0;
  159. list-style-type: decimal;
  160. }
  161. [dir="rtl"] ol {
  162. margin-right: 2em;
  163. margin-left: 0;
  164. }
  165. /**
  166. * Fix duplicate border caused by normalize.css adding border-bottom without
  167. * removing the text-decoration.
  168. */
  169. abbr[title] {
  170. text-decoration: none;
  171. }
  172. code {
  173. margin: 0.5em 0;
  174. }
  175. pre {
  176. margin: 0.5em 0;
  177. white-space: pre-wrap;
  178. }
  179. details {
  180. line-height: 1.295em;
  181. }
  182. details summary {
  183. padding: 0.95em 1.45em;
  184. }
  185. details summary:focus {
  186. outline: none;
  187. }
  188. img {
  189. max-width: 100%;
  190. height: auto;
  191. }
  192. /**
  193. * Default focus styles for focused elements.
  194. *
  195. * This is applied globally to all interactive elements except Toolbar and
  196. * Settings Tray since they have their own styles.
  197. *
  198. * @todo https://www.drupal.org/project/claro/issues/3048785 :focus selector is
  199. * active for non-interactive elements in Internet Explorer 11.
  200. */
  201. .page-wrapper *:focus,
  202. .ui-dialog *:focus {
  203. outline: var(--focus-outline);
  204. box-shadow: var(--focus-box-shadow);
  205. }

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