opinionated.css 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. /* Document
  2. * ========================================================================== */
  3. /**
  4. * 1. Correct the line height in all browsers.
  5. * 2. Prevent adjustments of font size after orientation changes in iOS.
  6. */
  7. :where(html) {
  8. line-height: 1.15; /* 1 */
  9. -webkit-text-size-adjust: 100%; /* 2 */
  10. text-size-adjust: 100%; /* 2 */
  11. }
  12. /* Sections
  13. * ========================================================================== */
  14. /**
  15. * Remove the margin in all browsers. (opinionated)
  16. */
  17. :where(body) {
  18. margin: 0;
  19. }
  20. /**
  21. * Correct the font size and margin on `h1` elements within `section` and
  22. * `article` contexts in Chrome, Edge, Firefox, and Safari.
  23. */
  24. :where(h1) {
  25. font-size: 2em;
  26. margin-block-end: 0.67em;
  27. margin-block-start: 0.67em;
  28. }
  29. /* Grouping content
  30. * ========================================================================== */
  31. /**
  32. * Remove the margin on nested lists in Chrome, Edge, and Safari.
  33. */
  34. :where(dl, ol, ul) :where(dl, ol, ul) {
  35. margin-block-end: 0;
  36. margin-block-start: 0;
  37. }
  38. /**
  39. * 1. Add the correct box sizing in Firefox.
  40. * 2. Correct the inheritance of border color in Firefox.
  41. */
  42. :where(hr) {
  43. box-sizing: content-box; /* 1 */
  44. color: inherit; /* 2 */
  45. height: 0; /* 1 */
  46. }
  47. /* Text-level semantics
  48. * ========================================================================== */
  49. /**
  50. * Add the correct text decoration in Safari.
  51. */
  52. :where(abbr[title]) {
  53. text-decoration: underline;
  54. text-decoration: underline dotted;
  55. }
  56. /**
  57. * Add the correct font weight in Chrome, Edge, and Safari.
  58. */
  59. :where(b, strong) {
  60. font-weight: bolder;
  61. }
  62. /**
  63. * 1. Correct the inheritance and scaling of font size in all browsers.
  64. * 2. Correct the odd `em` font sizing in all browsers.
  65. */
  66. :where(code, kbd, pre, samp) {
  67. font-family: monospace, monospace; /* 1 */
  68. font-size: 1em; /* 2 */
  69. }
  70. /**
  71. * Add the correct font size in all browsers.
  72. */
  73. :where(small) {
  74. font-size: 80%;
  75. }
  76. /* Tabular data
  77. * ========================================================================== */
  78. /**
  79. * 1. Correct table border color in Chrome, Edge, and Safari.
  80. * 2. Remove text indentation from table contents in Chrome, Edge, and Safari.
  81. */
  82. :where(table) {
  83. border-color: currentColor; /* 1 */
  84. text-indent: 0; /* 2 */
  85. }
  86. /* Forms
  87. * ========================================================================== */
  88. /**
  89. * Remove the margin on controls in Safari.
  90. */
  91. :where(button, input, select) {
  92. margin: 0;
  93. }
  94. /**
  95. * Remove the inheritance of text transform in Firefox.
  96. */
  97. :where(button) {
  98. text-transform: none;
  99. }
  100. /**
  101. * Correct the inability to style buttons in iOS and Safari.
  102. */
  103. :where(button, input:is([type="button" i], [type="reset" i], [type="submit" i])) {
  104. -webkit-appearance: button;
  105. }
  106. /**
  107. * Add the correct vertical alignment in Chrome, Edge, and Firefox.
  108. */
  109. :where(progress) {
  110. vertical-align: baseline;
  111. }
  112. /**
  113. * Remove the inheritance of text transform in Firefox.
  114. */
  115. :where(select) {
  116. text-transform: none;
  117. }
  118. /**
  119. * Remove the margin in Firefox and Safari.
  120. */
  121. :where(textarea) {
  122. margin: 0;
  123. }
  124. /**
  125. * 1. Correct the odd appearance in Chrome, Edge, and Safari.
  126. * 2. Correct the outline style in Safari.
  127. */
  128. :where(input[type="search" i]) {
  129. -webkit-appearance: textfield; /* 1 */
  130. outline-offset: -2px; /* 2 */
  131. }
  132. /**
  133. * Correct the cursor style of increment and decrement buttons in Safari.
  134. */
  135. ::-webkit-inner-spin-button,
  136. ::-webkit-outer-spin-button {
  137. height: auto;
  138. }
  139. /**
  140. * Correct the text style of placeholders in Chrome, Edge, and Safari.
  141. */
  142. ::-webkit-input-placeholder {
  143. color: inherit;
  144. opacity: 0.54;
  145. }
  146. /**
  147. * Remove the inner padding in Chrome, Edge, and Safari on macOS.
  148. */
  149. ::-webkit-search-decoration {
  150. -webkit-appearance: none;
  151. }
  152. /**
  153. * 1. Correct the inability to style upload buttons in iOS and Safari.
  154. * 2. Change font properties to `inherit` in Safari.
  155. */
  156. ::-webkit-file-upload-button {
  157. -webkit-appearance: button; /* 1 */
  158. font: inherit; /* 2 */
  159. }
  160. /**
  161. * Remove the inner border and padding of focus outlines in Firefox.
  162. */
  163. :where(button, input:is([type="button" i], [type="color" i], [type="reset" i], [type="submit" i]))::-moz-focus-inner {
  164. border-style: none;
  165. padding: 0;
  166. }
  167. /**
  168. * Restore the focus outline styles unset by the previous rule in Firefox.
  169. */
  170. :where(button, input:is([type="button" i], [type="color" i], [type="reset" i], [type="submit" i]))::-moz-focusring {
  171. outline: 1px dotted ButtonText;
  172. }
  173. /**
  174. * Remove the additional :invalid styles in Firefox.
  175. */
  176. :where(:-moz-ui-invalid) {
  177. box-shadow: none;
  178. }
  179. /* Interactive
  180. * ========================================================================== */
  181. /*
  182. * Add the correct styles in Safari.
  183. */
  184. :where(dialog) {
  185. background-color: white;
  186. border: solid;
  187. color: black;
  188. height: -moz-fit-content;
  189. height: fit-content;
  190. left: 0;
  191. margin: auto;
  192. padding: 1em;
  193. position: absolute;
  194. right: 0;
  195. width: -moz-fit-content;
  196. width: fit-content;
  197. }
  198. :where(dialog:not([open])) {
  199. display: none;
  200. }
  201. /*
  202. * Add the correct display in all browsers.
  203. */
  204. :where(summary) {
  205. display: list-item;
  206. }