_mdn.scss 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. ._mdn {
  2. container-type: inline-size;
  3. .index { // HTML, CSS
  4. -webkit-columns: 16em;
  5. -moz-columns: 16em;
  6. columns: 16em;
  7. > span {
  8. display: block;
  9. font-size: 1rem;
  10. font-weight: var(--boldFontWeight);
  11. }
  12. ul, ol {
  13. margin: 0 0 1em;
  14. padding: 0;
  15. line-height: 1.5;
  16. list-style: none;
  17. }
  18. li { padding-left: 1em; }
  19. }
  20. > h2 { @extend %block-heading; }
  21. > h3 { @extend %block-label, %label-blue; }
  22. > h4 { font-size: 1em; }
  23. p > code, li > code { @extend %label; }
  24. details { @extend %note; @extend %box; }
  25. details.baseline-indicator.not { @extend %note; @extend %note-gray; }
  26. details.baseline-indicator.low { @extend %note; @extend %note-blue; }
  27. details.baseline-indicator.high { @extend %note; @extend %note-green; }
  28. summary > div { display: inline; }
  29. summary .status-title { font-weight: bold; }
  30. > .note,
  31. .notecard, // MDN 2021
  32. .notice {
  33. @extend %note; @extend %note-blue;
  34. }
  35. .warning,
  36. .overheadIndicator,
  37. .blockIndicator,
  38. .syntaxbox, // CSS, JavaScript
  39. .twopartsyntaxbox, // CSS
  40. .inheritsbox, // JavaScript
  41. .eval:first-of-type { // JavaScript
  42. @extend %note;
  43. }
  44. .warning { @extend %note-red; }
  45. > .note {
  46. em {
  47. font-style: normal;
  48. font-weight: var(--boldFontWeight);
  49. }
  50. > ul { margin: 1em 0; }
  51. > p:last-child, > ul:last-child { margin-bottom: 0; }
  52. }
  53. .inlineIndicator {
  54. white-space: nowrap;
  55. @extend %label;
  56. }
  57. .syntaxbox a, // CSS
  58. .twopartsyntaxbox a, // CSS
  59. .inlineIndicator > a {
  60. color: inherit;
  61. @extend %internal-link;
  62. }
  63. .deprecated, .obsolete { @extend %label-red; }
  64. .nonStandard, .projectSpecific, .experimental { @extend %label-orange; }
  65. .htmlelt,
  66. .cssprop {
  67. display: table;
  68. @extend %note, %note-blue;
  69. > li {
  70. display: table-row;
  71. margin: 0;
  72. > dfn {
  73. display: table-cell;
  74. padding: .125rem 1.5rem .125rem 0;
  75. white-space: pre;
  76. border: 0;
  77. cursor: inherit;
  78. &:after { content: ':'; }
  79. }
  80. }
  81. th, td {
  82. background: none;
  83. border: 0;
  84. }
  85. }
  86. dt > strong > code, // HTML element attribute
  87. dl > dt > code { // CSS property value, Javascript function argument
  88. font-family: inherit;
  89. font-weight: var(--boldFontWeight);
  90. font-size: inherit;
  91. }
  92. .eventinfo { // DOM event
  93. > dd + dt { margin-top: 0; }
  94. }
  95. .cleared { clear: both; } // CSS/box-shadow
  96. code > strong { font-weight: normal; }
  97. // Compatibility tables
  98. .bc-github-link {
  99. float: right;
  100. font-size: .75rem;
  101. }
  102. .bc-supports-yes, .bc-supports-yes + dd, .bc-supports-yes + dd + dd { background: var(--noteGreenBackground); }
  103. .bc-supports-unknown, .bc-supports-unknown + dd, .bc-supports-unknown + dd + dd { background: var(--noteBackground); }
  104. .bc-supports-partial, .bc-supports-partial + dd, .bc-supports-partial + dd + dd { background: var(--noteOrangeBackground); }
  105. .bc-supports-no, .bc-supports-no + dd, .bc-supports-no + dd + dd { background: var(--noteRedBackground); }
  106. .bc-table {
  107. min-width: 100%;
  108. dl {
  109. margin: .25rem 0 0;
  110. padding: .25rem 0 0;
  111. font-size: .75rem;
  112. border-top: 1px solid var(--boxBorder);
  113. }
  114. dd { margin: 0; }
  115. }
  116. // based on https://github.com/mdn/yari/blob/63936bc42c/client/src/document/interactive-examples.scss
  117. .interactive {
  118. width: 100%;
  119. height: 680px;
  120. &.is-js-height {
  121. height: 520px;
  122. }
  123. &.is-shorter-height {
  124. height: 440px;
  125. }
  126. &.is-taller-height {
  127. height: 730px;
  128. }
  129. &.is-tabbed-shorter-height {
  130. height: 490px;
  131. }
  132. &.is-tabbed-standard-height {
  133. height: 550px;
  134. }
  135. &.is-tabbed-taller-height {
  136. height: 780px;
  137. }
  138. }
  139. @container (min-width: 594px) {
  140. .interactive {
  141. height: 380px;
  142. &.is-js-height {
  143. height: 450px;
  144. }
  145. &.is-shorter-height {
  146. height: 370px;
  147. }
  148. &.is-taller-height {
  149. height: 660px;
  150. }
  151. &.is-tabbed-shorter-height {
  152. height: 360px;
  153. }
  154. &.is-tabbed-standard-height {
  155. height: 430px;
  156. }
  157. &.is-tabbed-taller-height {
  158. height: 640px;
  159. }
  160. }
  161. }
  162. }