diff --git a/.stylelintrc.yml b/.stylelintrc.yml index ac3d42fc1d..bc7a9f14a1 100644 --- a/.stylelintrc.yml +++ b/.stylelintrc.yml @@ -5,6 +5,7 @@ extends: - stylelint-config-sass-guidelines plugins: - stylelint-scss + - stylelint-order rules: # Line Spacing rule-empty-line-before: @@ -39,7 +40,8 @@ rules: - ignoreProperties: - 'box-orient' - ignoreAtRules: ['each', 'else', 'extend', 'for', 'function', 'if', 'include', 'mixin', 'return', 'while'] - + # Imports + import-notation: 'string' # Nesting max-nesting-depth: - 5 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-12_0_document_0_desktop.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-12_0_document_0_desktop.png new file mode 100644 index 0000000000..0a4cba54af --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-12_0_document_0_desktop.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d37c83d266299c8eda91d76b14e1ed88d584579b19aa0ad2d9676ccf9d29e298 +size 11613 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-12_0_document_1_tablet.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-12_0_document_1_tablet.png new file mode 100644 index 0000000000..91b39f42eb --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-12_0_document_1_tablet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01f868db9e59800eadf9691211bb987758f59058a4685a4b8628feec801fef20 +size 6797 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-12_0_document_2_mobile.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-12_0_document_2_mobile.png new file mode 100644 index 0000000000..d74b9ce6c9 --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-12_0_document_2_mobile.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abc5b8e7cf62e33c23aed6dc7b0dfab4c91c2e0935ba94b254d6157435391873 +size 9532 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-7-4_0_document_0_desktop.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-7-4_0_document_0_desktop.png new file mode 100644 index 0000000000..7decaa610d --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-7-4_0_document_0_desktop.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6328dd084df3542c832044d04a88002ccf81470edcd8800fbac800b1e4dfc1e9 +size 11589 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-7-4_0_document_1_tablet.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-7-4_0_document_1_tablet.png new file mode 100644 index 0000000000..188ca5fb01 --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-7-4_0_document_1_tablet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6872ad2eeec9914606a55dfaafc34f97373405cfe36b9bdc4ff6d23f009cb0d +size 6344 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-7-4_0_document_2_mobile.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-7-4_0_document_2_mobile.png new file mode 100644 index 0000000000..b57d4da56d --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-7-4_0_document_2_mobile.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6dcc76c09a3bfa54582da37ceb898db035badf5641d4e973846ae34bb5acc83f +size 3846 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-8_0_document_0_desktop.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-8_0_document_0_desktop.png new file mode 100644 index 0000000000..35f24264c7 --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-8_0_document_0_desktop.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1898d8055949b68976abe2e9b818b3da44d41954f76d807b24bae0cefa89f4a5 +size 11509 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-8_0_document_1_tablet.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-8_0_document_1_tablet.png new file mode 100644 index 0000000000..697757f81b --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-8_0_document_1_tablet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:492b3324ad0f9a9efab726668f7bc20943858ed0c96bb12a43eda9b1025def39 +size 6240 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-8_0_document_2_mobile.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-8_0_document_2_mobile.png new file mode 100644 index 0000000000..e97353c35d --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-8_0_document_2_mobile.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e8bdb062f1fc26ca0eb641bdbe4480c8295c683f4a9b0ebf6b820d58a16741e +size 3325 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-combo_0_document_0_desktop.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-combo_0_document_0_desktop.png new file mode 100644 index 0000000000..a26e04005a --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-combo_0_document_0_desktop.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ddb6048c5041f7d085cbaee20aa0297ec71c43f8897eae7b579575871d56cd74 +size 14966 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-combo_0_document_1_tablet.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-combo_0_document_1_tablet.png new file mode 100644 index 0000000000..db1113bbdf --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-combo_0_document_1_tablet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65f12ace853f664da601a21abf34858dd54274a8d67f2eb7307690db0521dfbf +size 10273 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-combo_0_document_2_mobile.png b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-combo_0_document_2_mobile.png new file mode 100644 index 0000000000..3e44646a4f --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__foundations_grid_example-grid-combo_0_document_2_mobile.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d38b465c42ea854e665b2e739ca91bacf1bc95ce02d23727f92e43c60252ad56 +size 24129 diff --git a/package.json b/package.json index 39376ef033..0b06ecc5d7 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "git add" ], "*.scss": [ - "prettier --print-width 140 --single-quote --parser postcss --write", + "prettier --print-width 140 --single-quote --parser scss --write", "yarn run stylelint-fix", "git add" ] @@ -123,6 +123,7 @@ "stylelint-config-recommended": "^13.0.0", "stylelint-config-sass-guidelines": "^10.0.0", "stylelint-config-standard": "^34.0.0", + "stylelint-order": "^6.0.3", "stylelint-scss": "^5.0.1", "through2": "^4.0.2", "tick-manager": "^1.0.3", diff --git a/src/components/access-code/access-code.scss b/src/components/access-code/access-code.scss index fd3df856ec..5023c5865a 100644 --- a/src/components/access-code/access-code.scss +++ b/src/components/access-code/access-code.scss @@ -6,17 +6,17 @@ text-transform: uppercase; width: 15.1em; - @media all and (min-width: 375px) { + @media all and (width >= 375px) { font-size: 20px !important; width: 15.1em !important; } - @media all and (max-width: 374px) { + @media all and (width <= 374px) { letter-spacing: 0; max-width: 12.6em !important; } - @media all and (max-width: 299px) { + @media all and (width <= 299px) { max-width: 100%; } diff --git a/src/components/autosuggest/_autosuggest.scss b/src/components/autosuggest/_autosuggest.scss index 2398f3b68f..39421c1f53 100644 --- a/src/components/autosuggest/_autosuggest.scss +++ b/src/components/autosuggest/_autosuggest.scss @@ -51,7 +51,7 @@ border-bottom: 1px solid var(--ons-color-input-border); } - &:not(&--no-results):not(&--more-results):hover, + &:not(&--no-results, &--more-results):hover, &--focused:not(&--no-results) { background: var(--ons-color-text-link-hover); border-color: var(--ons-color-text-link-hover); @@ -63,7 +63,7 @@ } } - &:active:not(&--no-results):not(&--more-results) { + &:active:not(&--no-results, &--more-results) { background: var(--ons-color-focus); color: var(--ons-color-text-link-focus); @@ -128,7 +128,7 @@ &--header { .ons-autosuggest__results { border: none; - box-shadow: 0 0 5px 0 rgba(34, 34, 34, 0.6); + box-shadow: 0 0 5px 0 rgb(34 34 34 / 60%); left: 0; position: absolute; z-index: 10; diff --git a/src/components/button/_button.scss b/src/components/button/_button.scss index 8cf202c54e..3955c1bb76 100644 --- a/src/components/button/_button.scss +++ b/src/components/button/_button.scss @@ -15,19 +15,16 @@ $button-shadow-size: 3px; position: relative; text-align: center; text-decoration: none; - text-rendering: optimizeLegibility; + text-rendering: optimizelegibility; vertical-align: top; white-space: nowrap; // Transparent border for IE11 High Contrast mode support due to 'border: 0' on buttons &::after { border: ems($button-shadow-size) solid transparent; - bottom: -(ems($button-shadow-size)); // makes sure button shadow is selectable + inset: 0 0 - (ems($button-shadow-size)) 0; // makes sure button shadow is selectable content: ''; - left: 0; position: absolute; - right: 0; - top: 0; } &--search { @@ -172,8 +169,8 @@ $button-shadow-size: 3px; text-decoration: none; } - &--link:focus:not(:active):not(&--secondary) &, - &--link:focus:hover:not(:active):not(&--secondary) & { + &--link:focus:not(:active, &--secondary) &, + &--link:focus:hover:not(:active, &--secondary) & { outline: inherit; &__inner { @@ -245,7 +242,8 @@ $button-shadow-size: 3px; &--text-link:active:focus & { &__inner { background-color: var(--ons-color-focus); - box-shadow: 0 -2px var(--ons-color-focus), 0 4px var(--ons-color-text-link-focus) !important; + box-shadow: 0 -2px var(--ons-color-focus), + 0 4px var(--ons-color-text-link-focus) !important; color: var(--ons-color-text-link-focus); .ons-icon { fill: var(--ons-color-text-link-focus); @@ -256,7 +254,7 @@ $button-shadow-size: 3px; &--ghost & { &__inner { background: transparent; - border: 2px solid rgba(255, 255, 255, 0.6); + border: 2px solid rgb(255 255 255 / 60%); box-shadow: none; color: var(--ons-color-text-inverse); .ons-icon { @@ -314,7 +312,7 @@ $button-shadow-size: 3px; &--ghost:hover & { &__inner { - background: rgba(0, 0, 0, 0.1); + background: rgb(0 0 0 / 10%); border-color: var(--ons-color-white); } } @@ -323,8 +321,8 @@ $button-shadow-size: 3px; &--ghost:active:focus &, &--ghost.active & { &__inner { - background: rgba(0, 0, 0, 0.2); - border-color: rgba(255, 255, 255, 0.6); + background: rgb(0 0 0 / 20%); + border-color: rgb(255 255 255 / 60%); color: var(--ons-color-text-inverse); .ons-icon { fill: var(--ons-color-text-inverse); @@ -514,8 +512,7 @@ $button-shadow-size: 3px; align-items: baseline; display: flex; - flex-direction: row; - flex-wrap: wrap; + flex-flow: row wrap; & .ons-btn, & a { diff --git a/src/components/checkboxes/_checkbox.scss b/src/components/checkboxes/_checkbox.scss index d84ac074bb..d15673774d 100644 --- a/src/components/checkboxes/_checkbox.scss +++ b/src/components/checkboxes/_checkbox.scss @@ -156,12 +156,9 @@ $checkbox-padding: 11px; background: var(--ons-color-white); border: 1px solid var(--ons-color-input-border); border-radius: 3px; - bottom: 0; + inset: 0; content: ''; - left: 0; position: absolute; - right: 0; - top: 0; z-index: -1; } diff --git a/src/components/download-resources/_download-resources.scss b/src/components/download-resources/_download-resources.scss index 30d9920c9d..914a17d488 100644 --- a/src/components/download-resources/_download-resources.scss +++ b/src/components/download-resources/_download-resources.scss @@ -49,22 +49,20 @@ &__panel--is-visible { background-color: var(--ons-color-white); - bottom: 0; + inset: 0; display: block; height: calc(100% - 76px); // Height of action buttons - left: 0; overflow-y: scroll; padding: 1rem; position: fixed; - right: 0; - top: 0; z-index: 10; } &__actions { background-color: var(--ons-color-white); bottom: 0; - box-shadow: 0 0 5px 0 rgba(34, 34, 34, 0.5), 0 -1px 0 0 rgba(65, 64, 66, 0.5); + box-shadow: 0 0 5px 0 rgb(34 34 34 / 50%), + 0 -1px 0 0 rgb(65 64 66 / 50%); display: flex; left: 0; padding: 1rem; diff --git a/src/components/helpers/_grid.scss b/src/components/helpers/_grid.scss new file mode 100644 index 0000000000..8335fd8c5e --- /dev/null +++ b/src/components/helpers/_grid.scss @@ -0,0 +1,6 @@ +.ons-pl-grid-col { + background: var(--ons-color-grey-5); + font-size: 0.8rem; + margin: 0 0 1rem; + padding: 1rem; +} diff --git a/src/components/helpers/grid.njk b/src/components/helpers/grid.njk new file mode 100644 index 0000000000..5a15023d48 --- /dev/null +++ b/src/components/helpers/grid.njk @@ -0,0 +1,19 @@ +{% macro patternLibExampleGrid(params) %} + {% if params.container -%} +