_mdn.scss 3.8 KB

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