diff --git a/.gitignore b/.gitignore
index 25571c3..0c01cc8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
-.DS_Store
-
.wiki
# Logs
@@ -31,8 +29,9 @@ node_modules
# Users Environment Variables
.lock-wscript
-# Compiled source files
+# Generated build files
+css/dist
-# Generated documentation & style guides
+# Generated documentation & style guides
docs/api
docs/styleguide
diff --git a/README.md b/README.md
index 8a0fe55..f5ef30e 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# xmeter
+# [xmeter](https://chharvey.github.io/xmeter/)
A default stylesheet with a set of tools that make designing with vertical rhythm easy.
Pronounced “Cross Meter”.
@@ -28,9 +28,9 @@ See `/src/__settings.less` for all the variables available.
Use the tools:
```less
-@import (reference) url('/node_modules/xmeter/css/src/__tool.fontsize.less');
+@import (reference) url('/node_modules/xmeter/css/src/__tool.transitions.less');
.my-selector {
- .font-size-el(2.0; 1.5);
+ .transitions(color, background-color; 500ms; ease-in-out);
}
```
Read about all of Xmeter’s tools (see `/docs/tools.md`).
@@ -40,21 +40,50 @@ Read about all of Xmeter’s tools (see `/docs/tools.md`).
Use Xmeter right out of the box on your own site.
Want to see what Xmeter can do? [Check out the style guide] (link pending).
-Locally:
+Each stylesheet is minified and optimized for production, and accompanied by a sourcemap ending in `.css.map`.
+It is recommended that you split up the stylesheet into media queries as shown below.
+
+The `dist/xmeter.css` stylesheet contains all code not nested in a media query
+(thus applying to `@media all`), and additionally any experimental code and deprecated code.
+All other stylesheets (`dist/xmeter-‹breakpoint›.css`) represents media-specific classes.
+For example, `xmeter-sG.css` contains `.o-Flex-sG`, which is identical to `.o-Flex`,
+but it only applies to media `screen and (min-width: 60em)`.
+The recommended approach is to link only the stylesheets you need, and update your ``s when your needs change.
+Your users will appreciate that.
+
+Mnemonic:
+1. Kilo
+2. Mega
+3. Giga
+4. Tera
+5. Peta
+
+#### Locally:
```bash
$ npm install xmeter
```
```html
-
+
+
+
+
+
+
+
+
+
+
+
```
-Remotely from a CDN (not recommended, unless deploying your `/node_modules/` isn’t possible):
+#### Remotely from a CDN:
+(not recommended, unless deploying your `/node_modules/` isn’t possible)
+
```html
-
+
```
-where `‹master›` can be any branch or tag.
-
-The stylesheet `xmeter.css` is already minified, and is accompanied by a sourcemap `xmeter.css.map`.
+where `‹master›` can be any release tag, commit, or branch, and `‹breakpoint›` represents the media query.
## Features
diff --git a/config/kss.json b/config/kss.json
index 89c62d8..db68b3a 100644
--- a/config/kss.json
+++ b/config/kss.json
@@ -3,7 +3,7 @@
"source": "css/src/",
"destination": "docs/styleguide/",
"css": [
- "../../css/xmeter.css",
+ "../../css/dist/xmeter.css",
"../../docs/css/kss.css"
],
"js": [
diff --git a/css/.npmignore b/css/.npmignore
new file mode 100644
index 0000000..cbdb961
--- /dev/null
+++ b/css/.npmignore
@@ -0,0 +1 @@
+!dist
diff --git a/css/src/_-fz.less b/css/src/_-fz.less
index 64fd03d..b329a0e 100644
--- a/css/src/_-fz.less
+++ b/css/src/_-fz.less
@@ -2,20 +2,21 @@
/*################################*\
xmeter | _-fz.less
\*################################*/
+@import (reference) url('./__settings.less');
+@import (reference) url('./__tool.fontsize.less');
// font-size
//
// The font-size Atoms set the font-size property.
//
-// These are two groups of Atoms: the first group simply sets the font size of an element,
-// and the second group uses the .font-size-el() mixin, which also affects line-height
-// for maintaining vertical rhythm. See __tool.fontsize.less for the mixin code.
+// CHANGED-DEPRECATED: Atoms starting with `.-fz-el-*` are deprecated and will be removed in v7.
+// Instead, you should use the `.h-FontSize` helper and define the `--font-scale` custom property on your own.
//
// All font sizes are available in /src/__settings.less.
//
//
author
Chris Harvey
-//
updated
+//
updated
//
//
// Markup:
@@ -29,16 +30,6 @@
//
atom (0.75)
//
quark (0.50)
//
-//
-//
universe (6.00/1.000)
-//
galaxy (4.00/1.125)
-//
star (3.00/1.000)
-//
planet (2.00/1.500)
-//
asteroid (1.50/1.000)
-//
molecule (1.00/1.500)
-//
atom (0.75/2.000)
-//
quark (0.50/3.000)
-//
//
// Weight: 1
//
@@ -54,34 +45,23 @@
.-fz-mill { font-size: (@g-font-size-mill * 1em) !important; }
.-fz-micr { font-size: (@g-font-size-micr * 1em) !important; }
-@media screen and (min-width: 30em) { .-fz-peta-sK { .-fz-peta; } .-fz-tera-sK { .-fz-tera; } .-fz-giga-sK { .-fz-giga; } .-fz-mega-sK { .-fz-mega; } .-fz-kilo-sK { .-fz-kilo; } .-fz-norm-sK { .-fz-norm; } .-fz-mill-sK { .-fz-mill; } .-fz-micr-sK { .-fz-micr; } }
-@media screen and (min-width: 45em) { .-fz-peta-sM { .-fz-peta; } .-fz-tera-sM { .-fz-tera; } .-fz-giga-sM { .-fz-giga; } .-fz-mega-sM { .-fz-mega; } .-fz-kilo-sM { .-fz-kilo; } .-fz-norm-sM { .-fz-norm; } .-fz-mill-sM { .-fz-mill; } .-fz-micr-sM { .-fz-micr; } }
-@media screen and (min-width: 60em) { .-fz-peta-sG { .-fz-peta; } .-fz-tera-sG { .-fz-tera; } .-fz-giga-sG { .-fz-giga; } .-fz-mega-sG { .-fz-mega; } .-fz-kilo-sG { .-fz-kilo; } .-fz-norm-sG { .-fz-norm; } .-fz-mill-sG { .-fz-mill; } .-fz-micr-sG { .-fz-micr; } }
-@media screen and (min-width: 75em) { .-fz-peta-sT { .-fz-peta; } .-fz-tera-sT { .-fz-tera; } .-fz-giga-sT { .-fz-giga; } .-fz-mega-sT { .-fz-mega; } .-fz-kilo-sT { .-fz-kilo; } .-fz-norm-sT { .-fz-norm; } .-fz-mill-sT { .-fz-mill; } .-fz-micr-sT { .-fz-micr; } }
-@media screen and (min-width: 90em) { .-fz-peta-sP { .-fz-peta; } .-fz-tera-sP { .-fz-tera; } .-fz-giga-sP { .-fz-giga; } .-fz-mega-sP { .-fz-mega; } .-fz-kilo-sP { .-fz-kilo; } .-fz-norm-sP { .-fz-norm; } .-fz-mill-sP { .-fz-mill; } .-fz-micr-sP { .-fz-micr; } }
-@media not all and (min-width: 30em) { .-fz-peta-nK { .-fz-peta; } .-fz-tera-nK { .-fz-tera; } .-fz-giga-nK { .-fz-giga; } .-fz-mega-nK { .-fz-mega; } .-fz-kilo-nK { .-fz-kilo; } .-fz-norm-nK { .-fz-norm; } .-fz-mill-nK { .-fz-mill; } .-fz-micr-nK { .-fz-micr; } }
-@media not all and (min-width: 45em) { .-fz-peta-nM { .-fz-peta; } .-fz-tera-nM { .-fz-tera; } .-fz-giga-nM { .-fz-giga; } .-fz-mega-nM { .-fz-mega; } .-fz-kilo-nM { .-fz-kilo; } .-fz-norm-nM { .-fz-norm; } .-fz-mill-nM { .-fz-mill; } .-fz-micr-nM { .-fz-micr; } }
-@media not all and (min-width: 60em) { .-fz-peta-nG { .-fz-peta; } .-fz-tera-nG { .-fz-tera; } .-fz-giga-nG { .-fz-giga; } .-fz-mega-nG { .-fz-mega; } .-fz-kilo-nG { .-fz-kilo; } .-fz-norm-nG { .-fz-norm; } .-fz-mill-nG { .-fz-mill; } .-fz-micr-nG { .-fz-micr; } }
-@media not all and (min-width: 75em) { .-fz-peta-nT { .-fz-peta; } .-fz-tera-nT { .-fz-tera; } .-fz-giga-nT { .-fz-giga; } .-fz-mega-nT { .-fz-mega; } .-fz-kilo-nT { .-fz-kilo; } .-fz-norm-nT { .-fz-norm; } .-fz-mill-nT { .-fz-mill; } .-fz-micr-nT { .-fz-micr; } }
-@media not all and (min-width: 90em) { .-fz-peta-nP { .-fz-peta; } .-fz-tera-nP { .-fz-tera; } .-fz-giga-nP { .-fz-giga; } .-fz-mega-nP { .-fz-mega; } .-fz-kilo-nP { .-fz-kilo; } .-fz-norm-nP { .-fz-norm; } .-fz-mill-nP { .-fz-mill; } .-fz-micr-nP { .-fz-micr; } }
-
-
-.-fz-el-peta { .font-size-el(@g-font-size-peta; 4) !important; }
-.-fz-el-tera { .font-size-el(@g-font-size-tera; 3) !important; }
-.-fz-el-giga { .font-size-el(@g-font-size-giga; 2) !important; }
-.-fz-el-mega { .font-size-el(@g-font-size-mega; 2) !important; }
-.-fz-el-kilo { .font-size-el(@g-font-size-kilo ) !important; }
-.-fz-el-norm { .font-size-el(@g-font-size-norm ) !important; }
-.-fz-el-mill { .font-size-el(@g-font-size-mill ) !important; }
-.-fz-el-micr { .font-size-el(@g-font-size-micr ) !important; }
-@media screen and (min-width: 30em) { .-fz-el-peta-sK { .-fz-el-peta; } .-fz-el-tera-sK { .-fz-el-tera; } .-fz-el-giga-sK { .-fz-el-giga; } .-fz-el-mega-sK { .-fz-el-mega; } .-fz-el-kilo-sK { .-fz-el-kilo; } .-fz-el-norm-sK { .-fz-el-norm; } .-fz-el-mill-sK { .-fz-el-mill; } .-fz-el-micr-sK { .-fz-el-micr; } }
-@media screen and (min-width: 45em) { .-fz-el-peta-sM { .-fz-el-peta; } .-fz-el-tera-sM { .-fz-el-tera; } .-fz-el-giga-sM { .-fz-el-giga; } .-fz-el-mega-sM { .-fz-el-mega; } .-fz-el-kilo-sM { .-fz-el-kilo; } .-fz-el-norm-sM { .-fz-el-norm; } .-fz-el-mill-sM { .-fz-el-mill; } .-fz-el-micr-sM { .-fz-el-micr; } }
-@media screen and (min-width: 60em) { .-fz-el-peta-sG { .-fz-el-peta; } .-fz-el-tera-sG { .-fz-el-tera; } .-fz-el-giga-sG { .-fz-el-giga; } .-fz-el-mega-sG { .-fz-el-mega; } .-fz-el-kilo-sG { .-fz-el-kilo; } .-fz-el-norm-sG { .-fz-el-norm; } .-fz-el-mill-sG { .-fz-el-mill; } .-fz-el-micr-sG { .-fz-el-micr; } }
-@media screen and (min-width: 75em) { .-fz-el-peta-sT { .-fz-el-peta; } .-fz-el-tera-sT { .-fz-el-tera; } .-fz-el-giga-sT { .-fz-el-giga; } .-fz-el-mega-sT { .-fz-el-mega; } .-fz-el-kilo-sT { .-fz-el-kilo; } .-fz-el-norm-sT { .-fz-el-norm; } .-fz-el-mill-sT { .-fz-el-mill; } .-fz-el-micr-sT { .-fz-el-micr; } }
-@media screen and (min-width: 90em) { .-fz-el-peta-sP { .-fz-el-peta; } .-fz-el-tera-sP { .-fz-el-tera; } .-fz-el-giga-sP { .-fz-el-giga; } .-fz-el-mega-sP { .-fz-el-mega; } .-fz-el-kilo-sP { .-fz-el-kilo; } .-fz-el-norm-sP { .-fz-el-norm; } .-fz-el-mill-sP { .-fz-el-mill; } .-fz-el-micr-sP { .-fz-el-micr; } }
-@media not all and (min-width: 30em) { .-fz-el-peta-nK { .-fz-el-peta; } .-fz-el-tera-nK { .-fz-el-tera; } .-fz-el-giga-nK { .-fz-el-giga; } .-fz-el-mega-nK { .-fz-el-mega; } .-fz-el-kilo-nK { .-fz-el-kilo; } .-fz-el-norm-nK { .-fz-el-norm; } .-fz-el-mill-nK { .-fz-el-mill; } .-fz-el-micr-nK { .-fz-el-micr; } }
-@media not all and (min-width: 45em) { .-fz-el-peta-nM { .-fz-el-peta; } .-fz-el-tera-nM { .-fz-el-tera; } .-fz-el-giga-nM { .-fz-el-giga; } .-fz-el-mega-nM { .-fz-el-mega; } .-fz-el-kilo-nM { .-fz-el-kilo; } .-fz-el-norm-nM { .-fz-el-norm; } .-fz-el-mill-nM { .-fz-el-mill; } .-fz-el-micr-nM { .-fz-el-micr; } }
-@media not all and (min-width: 60em) { .-fz-el-peta-nG { .-fz-el-peta; } .-fz-el-tera-nG { .-fz-el-tera; } .-fz-el-giga-nG { .-fz-el-giga; } .-fz-el-mega-nG { .-fz-el-mega; } .-fz-el-kilo-nG { .-fz-el-kilo; } .-fz-el-norm-nG { .-fz-el-norm; } .-fz-el-mill-nG { .-fz-el-mill; } .-fz-el-micr-nG { .-fz-el-micr; } }
-@media not all and (min-width: 75em) { .-fz-el-peta-nT { .-fz-el-peta; } .-fz-el-tera-nT { .-fz-el-tera; } .-fz-el-giga-nT { .-fz-el-giga; } .-fz-el-mega-nT { .-fz-el-mega; } .-fz-el-kilo-nT { .-fz-el-kilo; } .-fz-el-norm-nT { .-fz-el-norm; } .-fz-el-mill-nT { .-fz-el-mill; } .-fz-el-micr-nT { .-fz-el-micr; } }
-@media not all and (min-width: 90em) { .-fz-el-peta-nP { .-fz-el-peta; } .-fz-el-tera-nP { .-fz-el-tera; } .-fz-el-giga-nP { .-fz-el-giga; } .-fz-el-mega-nP { .-fz-el-mega; } .-fz-el-kilo-nP { .-fz-el-kilo; } .-fz-el-norm-nP { .-fz-el-norm; } .-fz-el-mill-nP { .-fz-el-mill; } .-fz-el-micr-nP { .-fz-el-micr; } }
+// CHANGED-DEPRECATED! Use inline styles or define your own stylesheets instead.
+.-fz-el-peta { --font-scale: @g-font-size-peta !important; --tracks: 4 !important; }
+.-fz-el-tera { --font-scale: @g-font-size-tera !important; --tracks: 3 !important; }
+.-fz-el-giga { --font-scale: @g-font-size-giga !important; --tracks: 2 !important; }
+.-fz-el-mega { --font-scale: @g-font-size-mega !important; --tracks: 2 !important; }
+.-fz-el-kilo { --font-scale: @g-font-size-kilo !important; }
+.-fz-el-norm { --font-scale: @g-font-size-norm !important; }
+.-fz-el-mill { --font-scale: @g-font-size-mill !important; }
+.-fz-el-micr { --font-scale: @g-font-size-micr !important; }
+@media (-ms-high-contrast: none), (-ms-high-contrast: active) {
+ .-fz-el-peta { .font-size-el(@g-font-size-peta; 4) !important; }
+ .-fz-el-tera { .font-size-el(@g-font-size-tera; 3) !important; }
+ .-fz-el-giga { .font-size-el(@g-font-size-giga; 2) !important; }
+ .-fz-el-mega { .font-size-el(@g-font-size-mega; 2) !important; }
+ .-fz-el-kilo { .font-size-el(@g-font-size-kilo; ) !important; }
+ .-fz-el-norm { .font-size-el(@g-font-size-norm; ) !important; }
+ .-fz-el-mill { .font-size-el(@g-font-size-mill; ) !important; }
+ .-fz-el-micr { .font-size-el(@g-font-size-micr; ) !important; }
+}
diff --git a/css/src/__tool.fontsize.less b/css/src/__tool.fontsize.less
index 27ae707..ccdc614 100644
--- a/css/src/__tool.fontsize.less
+++ b/css/src/__tool.fontsize.less
@@ -22,10 +22,17 @@
font-size: (@ratio * 1rem);
// line-height: inherit; // NOTE clarification
& > * {
- --lh: calc(@ratio ~' * var(--line-height) * 1rem'); // @ratio * parent lh
+ // COMBAK-FALLBACK for `lh` units. TODO remove after `lh` is supported.
+ --lh: calc(@ratio * var(--line-height) * 1rem); // @ratio * parent lh
}
}
+// CHANGED:
+// This mixin no longer uses the `var(--line-height)` expression, and instead
+// uses the fallback value of 1.5. This mixin should only be used where
+// CSS custom properties are not supported. For the most recent method,
+// see documentation on the `.h-FontSize` helper.
+//
// Sets the font size of an element within a module (or if not, in the root)
// while preserving vertical rhythm.
// Font size is set in ems so that it will scale accordingly with its
@@ -35,15 +42,16 @@
// `font-size` * `line-height` = one vertical rhythm unit
//
// ^params
-// @ratio - (default: 1) the ratio of the new font size to
+// @fontscale - (default: 1) the ratio of the new font size to
// the parent font size, i.e., the number of ems
-// @lines - (default: 1) the number of vrus each line of text will take up.
+// @tracks - (default: 1) the number of vrus each line of text will take up.
// should be a whole number to satisfy vertical rhythm.
// ^author
// : Chris Harvey
// ^updated
-// : 2016-10-01
-.font-size-el(@ratio: 1; @lines: 1) {
- font-size: (@ratio * 1em);
- line-height: calc(~'var(--line-height) / ' (@ratio/@lines));
+// : 2018-03-21
+.font-size-el(@fontscale: 1; @tracks: 1) {
+ @lineheight: 1.5;
+ font-size: (@fontscale * 1em);
+ line-height: (@lineheight / @fontscale * @tracks);
}
diff --git a/css/src/_base.less b/css/src/_base.less
index 763ba06..7e61057 100644
--- a/css/src/_base.less
+++ b/css/src/_base.less
@@ -2,8 +2,14 @@
/*################################*\
xmeter | _base.less
\*################################*/
+@import (reference) url('./__settings.less');
+@import (reference) url('./__tool.fontsize.less');
+@import (reference) url('./__tool.borders.less');
+@import (reference) url('./__tool.delims.less');
+@import (reference) url('./_h-FontSize.less');
+@p-line-height: 1.5; // equivalent to custom prop `--line-height` // COMBAK-FALLBACK for custom property
// Contents
// ------------------------------------
// # GENERIC...........................`html` and far-reaching page-wide selectors
@@ -18,6 +24,9 @@
// ## Documentation......................documentation elements
// ## Data...............................machine- or human-readable data
// # FORMS.............................form elements
+// ## Resets.............................resets for form elements
+// ## Textual............................textual form elements
+// ## Buttons............................button-like form elements
// # EMBEDDED..........................images, videos, other media
// # INTERACTIVE.......................user-interactive HTML elements
@@ -25,6 +34,9 @@
//++++++++++++++++++++++++++++++++//
// # GENERIC
//++++++++++++++++++++++++++++++++//
+@import (inline) url('reset.css');
+@import (inline) url('../../node_modules/normalize.css/normalize.css');
+
* {
&,
&::before,
@@ -39,20 +51,26 @@
}
}
&:not(input):not(button):not(select), // NOTE be careful here: if overriding, specificity > 3
- // &:not(input, button, select), // CHANGED selector not supported yet
+ // &:not(input, button, select), // CHANGED selector not supported yet // TODO once removed, fix NB-LINK (L468)
&::before,
&::after {
border: 0 solid; // change initial border from `medium none`
}
}
+// Set up vertical rhythm system.
+// [1] default line-height. Change in your own project if you wish.
+// [2] COMBAK-FALLBACK for `lh` units (https://drafts.csswg.org/css-values/#lh)
+// [3] CHANGED-DEPRECATED: legacy support
+// [4] addresses support for `rem` units (otherwise these would be in `body` selector)
+// [5] Root font-size (rem) should *not* be set to an absolute unit, so that users can specify
+// font sizing settings in their user agent.
html {
- --line-height: 1.5; // default line-height. NOTE: change in your own project if you wish.
- --lh: calc(~'var(--line-height) * 1rem'); // HACK fallback for `lh` units (https://drafts.csswg.org/css-values/#lh)
- --vru: var(--lh); // CHANGED DEPRECATED: legacy support
- // addresses support for `rem` units (otherwise these would be in `body` selector)
- font-size: 100%; // defined by user agent
- line-height: var(--line-height);
+ --line-height: 1.5; // [1]
+ --lh: calc(var(--line-height) * 1rem); // [2]
+ --vru: var(--lh); // [3]
+ font-size: 100%; // [4] [5]
+ line-height: var(--line-height); // [4]
}
// Vertical spacing between typographical blocks
@@ -67,8 +85,8 @@ details {
margin-bottom: 1lh;
@supports (margin-block-end: var(--variable)) {
margin-bottom: unset;
- margin-block-end: var(--lh);
- margin-block-end: 1lh;
+ margin-block-end: var(--lh);
+ margin-block-end: 1lh;
}
}
h1 {
@@ -76,8 +94,8 @@ h1 {
padding-top: 1lh;
@supports (padding-block-start: var(--variable)) {
padding-top: unset;
- padding-block-start: var(--lh);
- padding-block-start: 1lh;
+ padding-block-start: var(--lh);
+ padding-block-start: 1lh;
}
}
@@ -97,18 +115,28 @@ label {
// Elements with a transparent content model
// should display what their contents display.
-a, ins, del {
- // display: inherit;
- // line-height: inherit;
- // h1 > &, h2 > &, h3 > &, h4 > &, h5 > &, h6 > &,
- // p > &, pre > &,
- // figure > &, figcaption > &, blockquote > &,
- // li > &, dt > &, dd > &,
- // caption > &, th > &, td > &,
- // legend > &, summary > & {
- // display: inline;
- // line-height: 0;
- // }
+a, ins, del, slot {
+}
+
+@media (-ms-high-contrast: none), (-ms-high-contrast: active) {
+ @lh: (@p-line-height * 1rem); // equivalent to unit `1lh`, or custom prop `--lh`
+ html {
+ line-height: @p-line-height;
+ }
+ h1, h2, h3, h4, h5, h6,
+ p, pre, figure, blockquote,
+ ol, ul, dl,
+ table,
+ form, fieldset, textarea,
+ details {
+ margin-bottom: @lh;
+ }
+ h1 {
+ padding-top: @lh;
+ }
+ textarea {
+ height: (6 * @lh);
+ }
}
//++++ end # GENERIC ++++//
@@ -136,18 +164,28 @@ footer {
}
h1, h2, h3, h4, h5, h6 {
+ .h-FontSize;
font-weight: 700;
}
-h1 { .font-size-el(@g-font-size-h1; 2); }
-h2 { .font-size-el(@g-font-size-h2; 2); }
-h3 { .font-size-el(@g-font-size-h3); }
-h4 { .font-size-el(@g-font-size-h4); }
-h5 { .font-size-el(@g-font-size-h5); }
-h6 { .font-size-el(@g-font-size-h6); }
+h1 { --font-scale: @g-font-size-h1; --tracks: 2; }
+h2 { --font-scale: @g-font-size-h2; --tracks: 2; }
+h3 { --font-scale: @g-font-size-h3; }
+h4 { --font-scale: @g-font-size-h4; }
+h5 { --font-scale: @g-font-size-h5; }
+h6 { --font-scale: @g-font-size-h6; }
+@media (-ms-high-contrast: none), (-ms-high-contrast: active) {
+ h1 { .font-size-el(@g-font-size-h1; 2); }
+ h2 { .font-size-el(@g-font-size-h2; 2); }
+ h3 { .font-size-el(@g-font-size-h3; ); }
+ h4 { .font-size-el(@g-font-size-h4; ); }
+ h5 { .font-size-el(@g-font-size-h5; ); }
+ h6 { .font-size-el(@g-font-size-h6; ); }
+}
h1 {
- margin-top: initial; // HACK fallback for `unset`
- margin-top: unset; // HACK fallback for logical
+ margin-top: 0; // COMBAK-FALLBACK
+ margin-top: initial; // COMBAK-FALLBACK
+ margin-top: unset; // COMBAK-FALLBACK
margin-block-start: unset; // undo Normalize
}
@@ -170,16 +208,23 @@ hr {
p {
}
pre {
- .font-size-el(@g-font-size-mill);
+ .h-FontSize;
+ --font-scale: @g-font-size-mill;
text-align: left; // code blocks are always aligned left, regardless of writing mode
text-indent: 0;
white-space: pre;
overflow: auto;
}
+ @media (-ms-high-contrast: none), (-ms-high-contrast: active) {
+ pre {
+ .font-size-el(@g-font-size-mill);
+ }
+ }
figure {
// undo Normalize
- margin-top: initial; margin-left: initial; margin-right: initial; // HACK fallbacks for `unset`
- margin-top: unset ; margin-left: unset ; margin-right: unset ; // HACK fallbacks for logical
+ margin-top: 0 ; margin-left: 0 ; margin-right: 0 ; // COMBAK-FALLBACK
+ margin-top: initial; margin-left: initial; margin-right: initial; // COMBAK-FALLBACK
+ margin-top: unset ; margin-left: unset ; margin-right: unset ; // COMBAK-FALLBACK
margin-block-start: unset;
margin-inline: unset;
}
@@ -198,22 +243,23 @@ hr {
li > &,
dt > &,
dd > & {
- margin-bottom: initial; // HACK fallback for `unset`
- margin-bottom: unset; // HACK fallback for logical
+ margin-bottom: 0; // COMBAK-FALLBACK
+ margin-bottom: initial; // COMBAK-FALLBACK
+ margin-bottom: unset; // COMBAK-FALLBACK
margin-block-end: unset; // undo default vertical spacing for nested lists
}
}
ol,
ul {
- padding: 0 0 0 4rem; // HACK fallback for logical
+ padding: 0 0 0 4rem; // COMBAK-FALLBACK
padding: logical 0 4rem 0 0;
li > &,
dt > &,
dd > & {
- padding-left: 2rem; // HACK fallback for logical
+ padding-left: 2rem; // COMBAK-FALLBACK
@supports (padding-inline-start: 1rem) {
padding-left: unset;
- padding-inline-start: 2rem;
+ padding-inline-start: 2rem;
}
}
}
@@ -316,7 +362,7 @@ br {
background-color: fadeout(#ffe168, 50%); // Google-flavored comments in Google Docs
}
u {
- text-decoration: underline; // HACK fallback
+ text-decoration: underline; // COMBAK-FALLBACK
text-decoration-line: underline;
color: #080;
}
@@ -324,7 +370,7 @@ br {
font-size: (@g-font-size-mill * 1em);
}
s {
- text-decoration: line-through; // HACK fallback
+ text-decoration: line-through; // COMBAK-FALLBACK
text-decoration-line: line-through;
color: #b00;
}
@@ -349,8 +395,8 @@ br {
abbr {
&[title] {
cursor: help;
- text-decoration: none; // HACK fallback for `text-decoration-line` // also IE fallback for `initial`
- text-decoration-line: initial; // HACK fallback for `unset`
+ text-decoration: none; // COMBAK-FALLBACK for `text-decoration-line` // also IE fallback for `initial`
+ text-decoration-line: initial; // COMBAK-FALLBACK
text-decoration-line: unset; // undo Normalize
}
}
@@ -358,6 +404,7 @@ br {
font-style: italic;
}
q {
+ .quotes-double(); // COMBAK-FALLBACK for `initial`
.delims(initial);
}
cite {
@@ -386,7 +433,7 @@ br {
font-size: inherit; // undo compounding font sizes
}
pre & {
- white-space: inherit; // HACK fallback
+ white-space: inherit; // COMBAK-FALLBACK
white-space: unset; // sometimes people put a `code` in a `pre` // override `nowrap` above
}
}
@@ -405,64 +452,68 @@ br {
//++++++++++++++++++++++++++++++++//
@p-color-gray: rgba(0,0,0, 0.25);
-fieldset {
- padding: 0 1rem;
-}
-
-textarea,
-input {
- padding: 0 0.25rem;
-}
-
+ //--------------------------------//
+ // ## Resets
+ //--------------------------------//
input,
button,
select,
textarea {
- line-height: inherit; // undo browser default
+ line-height: inherit; // override opinionated Normalize.css
}
+ //---- end ## Resets ----//
-html body fieldset { // HACK need a specificity of 3 to override generic `*:not(input):not(button):not(select)`
- .border-vert(all; 1px);
- .border-block(all; 1px);
- border-style: solid;
- border-color: @p-color-gray;
- // NOTE cannot use box-shadow hack due to shadow covering