From a1e745c686dee189627e00a5d1c4bf87b3935cc2 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Sat, 25 Dec 2021 18:28:17 +0100 Subject: [PATCH] Replace obsolete normalize with a lightweight reset. --- assets/sass/_colors.scss | 1 + assets/sass/_variables.scss | 2 +- assets/sass/_zen.scss | 7 + assets/sass/base/_normalize.scss | 25 -- assets/sass/base/embedded/_embedded.scss | 31 --- assets/sass/base/forms/_forms.scss | 229 ------------------ assets/sass/base/grouping/_grouping.scss | 141 ----------- assets/sass/base/scripting/_scripting.scss | 13 - assets/sass/base/text/_text.scss | 165 ------------- assets/sass/components/box/box.json | 4 - assets/sass/components/button/_button.scss | 58 ++--- assets/sass/components/divider/divider.json | 3 - .../sass/components/monospace/_monospace.scss | 10 + .../visually-hidden/visually-hidden.json | 3 - .../sass/components/watermark/_watermark.scss | 1 - .../sass/components/watermark/watermark.json | 4 - .../sass/components/wireframe/wireframe.json | 3 - assets/sass/reset/_reset.scss | 12 + .../{base => reset}/document/_document.scss | 14 +- assets/sass/reset/embedded/_embedded.scss | 15 ++ assets/sass/reset/forms/_forms.scss | 25 ++ assets/sass/reset/grouping/_grouping.scss | 78 ++++++ .../interactive/_interactive.scss | 12 - assets/sass/{base => reset}/links/_links.scss | 3 - .../{base => reset}/sections/_sections.scss | 0 .../sass/{base => reset}/tables/_tables.scss | 0 assets/sass/reset/text/_text.scss | 38 +++ assets/sass/styles.scss | 26 +- 28 files changed, 220 insertions(+), 703 deletions(-) delete mode 100644 assets/sass/base/_normalize.scss delete mode 100644 assets/sass/base/embedded/_embedded.scss delete mode 100644 assets/sass/base/forms/_forms.scss delete mode 100644 assets/sass/base/grouping/_grouping.scss delete mode 100644 assets/sass/base/scripting/_scripting.scss delete mode 100644 assets/sass/base/text/_text.scss delete mode 100644 assets/sass/components/box/box.json delete mode 100644 assets/sass/components/divider/divider.json create mode 100644 assets/sass/components/monospace/_monospace.scss delete mode 100644 assets/sass/components/visually-hidden/visually-hidden.json delete mode 100644 assets/sass/components/watermark/watermark.json delete mode 100644 assets/sass/components/wireframe/wireframe.json create mode 100644 assets/sass/reset/_reset.scss rename assets/sass/{base => reset}/document/_document.scss (74%) create mode 100644 assets/sass/reset/embedded/_embedded.scss create mode 100644 assets/sass/reset/forms/_forms.scss create mode 100644 assets/sass/reset/grouping/_grouping.scss rename assets/sass/{base => reset}/interactive/_interactive.scss (66%) rename assets/sass/{base => reset}/links/_links.scss (85%) rename assets/sass/{base => reset}/sections/_sections.scss (100%) rename assets/sass/{base => reset}/tables/_tables.scss (100%) create mode 100644 assets/sass/reset/text/_text.scss diff --git a/assets/sass/_colors.scss b/assets/sass/_colors.scss index 8d71ee4..dccda8f 100644 --- a/assets/sass/_colors.scss +++ b/assets/sass/_colors.scss @@ -48,6 +48,7 @@ $colors: ( mobile-menu-cover: rgba($black, .2), button: $nearblack, + button-text: $white, button-disabled: $grey, form-error: $red, diff --git a/assets/sass/_variables.scss b/assets/sass/_variables.scss index d7555d4..db229f5 100644 --- a/assets/sass/_variables.scss +++ b/assets/sass/_variables.scss @@ -63,7 +63,7 @@ $font-weight: ( $times-new-roman: 'Times New Roman', Times, Georgia, 'DejaVu Serif', serif; $times: Times, 'Times New Roman', Georgia, 'DejaVu Serif', serif; $georgia: Georgia, 'Times New Roman', 'DejaVu Serif', serif; -$garamond: 'Garamond Premier Pro', Charter, 'Times New Roman', serif; +$garamond: 'Garamond Premier Pro', Garamond, Charter, 'Times New Roman', serif; // Sans-serif font stacks. $verdana: Verdana, Tahoma, 'DejaVu Sans', sans-serif; diff --git a/assets/sass/_zen.scss b/assets/sass/_zen.scss index 8d612a7..da0577f 100644 --- a/assets/sass/_zen.scss +++ b/assets/sass/_zen.scss @@ -298,6 +298,13 @@ figure { } } +// Icons. + +.icon { + // Reset set SVG to block but icons are normally inline. + display: inline; +} + // Header anchor links .anchor-link { diff --git a/assets/sass/base/_normalize.scss b/assets/sass/base/_normalize.scss deleted file mode 100644 index 74f9522..0000000 --- a/assets/sass/base/_normalize.scss +++ /dev/null @@ -1,25 +0,0 @@ -// Normalize.css is intended to be used as an alternative to CSS resets. -// -// @see https://necolas.github.io/normalize.css/ -// -// This directory is a slight fork of this original source: -// normalize.css 8.0.1 | MIT License - - -// Universal -// ========================================================================== - -// Broken into modular pieces to make it easier to edit. -@import 'document/document'; -@import 'sections/sections'; -@import 'grouping/grouping'; -@import 'links/links'; -@import 'text/text'; -@import 'embedded/embedded'; -@import 'forms/forms'; -@import 'tables/tables'; -@import 'interactive/interactive'; -@import 'scripting/scripting'; - -// Note: we allow the .button component (loaded by forms) to override :link, by -// loading links first. diff --git a/assets/sass/base/embedded/_embedded.scss b/assets/sass/base/embedded/_embedded.scss deleted file mode 100644 index 68147c5..0000000 --- a/assets/sass/base/embedded/_embedded.scss +++ /dev/null @@ -1,31 +0,0 @@ -// Embedded content - -// Audio - -audio { - // Add your styles. -} - -// Image -// -// An `` element represents an image. - -img { - // Add your styles. -} - -img, -svg { - // Suppress the space beneath the baseline - // vertical-align: bottom; - - // Responsive images - max-width: 100%; - height: auto; -} - -// Video - -video { - // Add your styles. -} diff --git a/assets/sass/base/forms/_forms.scss b/assets/sass/base/forms/_forms.scss deleted file mode 100644 index 95fff17..0000000 --- a/assets/sass/base/forms/_forms.scss +++ /dev/null @@ -1,229 +0,0 @@ -// stylelint-disable property-no-vendor-prefix - -// Form defaults -// -// These are the default base styles applied to HTML form elements. -// -// Component classes can override these styles, but if no class applies a style -// to an HTML form element, these styles will be the ones displayed. - -// -// The following rules are from normalize.css and help to fix inconsistencies -// across various browsers. You should probably leave these rules as is and jump -// to the "Buttons" rule on line 92 before you start editing this file. -// - -button, -input, -optgroup, -select, -textarea { - // Change the font styles in all browsers (opinionated). - @include typeface(body); - @include line-height(1); - font-size: 100%; - // Keep form elements constrained in their containers. - box-sizing: border-box; - max-width: 100%; - // Remove the margin in Firefox and Safari. - margin: 0; -} - -// Show the overflow in IE. -button { - overflow: visible; -} - -// Remove the inheritance of text transform in Edge, Firefox, and IE. -button, -select { - text-transform: none; -} - -// Show the overflow in Edge. -input { - overflow: visible; -} - -// Correct the cursor style of increment and decrement buttons in Chrome. -[type='number']::-webkit-inner-spin-button, -[type='number']::-webkit-outer-spin-button { - height: auto; -} - -[type='search'] { - // Correct the odd appearance in Chrome and Safari. - -webkit-appearance: textfield; - // Correct the outline style in Safari. - outline-offset: -2px; - - // Remove the inner padding and cancel buttons in Chrome and Safari on macOS. - &::-webkit-search-cancel-button, - &::-webkit-search-decoration { - -webkit-appearance: none; - } -} - -::-webkit-file-upload-button { - // Correct the inability to style clickable types in iOS and Safari. - -webkit-appearance: button; - // Change font properties to `inherit` in Safari. - font: inherit; -} - -// Buttons -// -// Buttons built with the `