diff --git a/.sass-lint.yml b/.sass-lint.yml index 52cfd74..f0996b8 100644 --- a/.sass-lint.yml +++ b/.sass-lint.yml @@ -31,15 +31,19 @@ rules: single-line-per-selector: 2 # Disallows - # no-color-keywords: 2 - # no-color-literals: 2 - # no-css-comments: 2 + no-attribute-selectors: 0 + no-color-hex: 2 + no-color-keywords: 2 + no-color-literals: 2 + no-combinators: 0 + no-css-comments: 2 no-debug: 2 - # no-duplicate-properties: 2 - no-empty-rulesets: 2 + no-disallowed-properties: 2 + no-duplicate-properties: 2 + no-empty-rulesets: 0 no-extends: 0 - # no-ids: 2 - # no-important: 2 + no-ids: 2 + no-important: 2 no-invalid-hex: 2 no-mergeable-selectors: 2 no-misspelled-properties: @@ -52,10 +56,12 @@ rules: - '*vertical-align' - '*width' no-qualifying-elements: 0 + no-trailing-whitespace: 2 no-trailing-zero: 2 - no-transition-all: 1 + no-transition-all: 0 + no-universal-selectors: 0 no-url-protocols: 2 - # no-vendor-prefixes: 2 + no-vendor-prefixes: 2 no-warn: 2 property-units: 0 @@ -79,6 +85,7 @@ rules: variable-name-format: 2 # Style Guide + attribute-quotes: 2 bem-depth: 0 border-zero: 2 brace-style: @@ -89,12 +96,13 @@ rules: empty-args: 0 hex-length: 2 hex-notation: 2 - # indentation: 2 + indentation: 2 leading-zero: 2 nesting-depth: - 2 - max-depth: 4 property-sort-order: 0 + pseudo-element: 1 quotes: 2 shorthand-values: 2 url-quotes: 2 @@ -114,14 +122,3 @@ rules: # Final Items trailing-semicolon: 2 final-newline: 2 - - # Work-around for sass-lint not having per-file/block/line rule config. - # @TODO: Re-enable these disabled rules. See https://www.drupal.org/node/2717117 - indentation: 0 - no-color-keywords: 0 - no-color-literals: 0 - no-css-comments: 0 - no-duplicate-properties: 0 - no-ids: 0 - no-important: 0 - no-vendor-prefixes: 0 diff --git a/sass/_custom.scss b/sass/_custom.scss index 0e57f30..218be72 100644 --- a/sass/_custom.scss +++ b/sass/_custom.scss @@ -1,4 +1,3 @@ -/** - * @file - * Site custom styles - */ +// sass-lint:disable no-css-comments, no-color-hex, no-color-literals + +// Site custom styles diff --git a/sass/_zen.scss b/sass/_zen.scss index c8e4927..c70807f 100644 --- a/sass/_zen.scss +++ b/sass/_zen.scss @@ -1,9 +1,4 @@ -/** - * @file - * Zen custom styles - */ - -/* Zen overrides */ +// Zen custom styles p, pre { @@ -11,7 +6,7 @@ pre { @include margin(.75 0); } -/* Page */ +// Page body { background-color: color(backdrop); @@ -40,7 +35,7 @@ body { } } -/* Apply smaller text to blocks, footer etc. */ +// Apply smaller text to blocks, footer etc. th, label, @@ -63,7 +58,7 @@ article > header, } } -/* Apply heading font stack to heading, labels etc. */ +// Apply heading font stack to heading, labels etc. h1, h2, @@ -215,7 +210,7 @@ figcaption { } } -/* Navigation */ +// Navigation .main-menu { @include margin-top(.5); @@ -251,7 +246,7 @@ figcaption { text-decoration: none; } -/* Messages */ +// Messages .message { padding: 10px; @@ -278,7 +273,7 @@ figcaption { } } -/* Search */ +// Search .search-form { @include padding(.5 0); @@ -288,7 +283,7 @@ figcaption { @include type-layout(l, 1); } -/* Form */ +// Form .content { input, diff --git a/sass/base/_fonts.scss b/sass/base/_fonts.scss index ad03ce7..c3e3858 100644 --- a/sass/base/_fonts.scss +++ b/sass/base/_fonts.scss @@ -9,6 +9,7 @@ // websites where you can find Open Source fonts to download: // - http://www.fontsquirrel.com/fontface // - http://www.theleagueofmoveabletype.com +// - https://fonts.google.com // // In order to use these fonts, you will need to convert them into formats // suitable for web fonts. We recommend the free-to-use Font Squirrel's diff --git a/sass/base/_html5.scss b/sass/base/_html5.scss deleted file mode 100644 index 2a1a594..0000000 --- a/sass/base/_html5.scss +++ /dev/null @@ -1,45 +0,0 @@ -// HTML5 display definitions -// ========================================================================== - -// Add the correct display in IE <10. -// Add the correct display in Edge, IE, and Firefox for `details` or `summary`. -// Add the correct display in IE for `main`. -article, -aside, -details, -figcaption, -figure, -footer, -header, -main, -menu, -nav, -section, -summary { - display: block; -} - -// Add the correct display in IE <10. -audio, -canvas, -progress, -video { - display: inline-block; -} - -// Add the correct display and remove excess height in iOS 4-7. -audio:not([controls]) { - display: none; - height: 0; -} - -// Add the correct vertical alignment in Chrome, Firefox, and Opera. -progress { - vertical-align: baseline; -} - -// Add the correct display in IE <11, Safari <8, and Firefox <22. -template, -[hidden] { - display: none; -} diff --git a/sass/base/_normalize.scss b/sass/base/_normalize.scss index d934fb1..7709454 100644 --- a/sass/base/_normalize.scss +++ b/sass/base/_normalize.scss @@ -6,19 +6,29 @@ // @see http://snook.ca/archives/html_and_css/no_css_reset/ // // This directory is a slight fork of this original source: -// - normalize-scss 5.0.3 | MIT/GPLv2 License | bit.ly/normalize-scss +// normalize-scss 7.0.0 | MIT/GPLv2 License | bit.ly/normalize-scss +// Universal +// ========================================================================== + +// Use the saner border-box model for all elements. +* { + box-sizing: border-box; +} + // Normalize-scss is broken into modular pieces to make it easier to edit. -@import 'root'; -@import 'html5'; -@import 'links/links'; -@import 'headings/headings'; -@import 'text/text'; +@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'; +@import 'hidden/hidden'; // Note: we allow the .button component (loaded by forms) to override :link, by // loading links first. diff --git a/sass/base/_root.scss b/sass/base/document/_document.scss similarity index 54% rename from sass/base/_root.scss rename to sass/base/document/_document.scss index 67f9de2..9737956 100644 --- a/sass/base/_root.scss +++ b/sass/base/document/_document.scss @@ -1,37 +1,23 @@ // sass-lint:disable no-vendor-prefixes -// Use the saner border-box model for all elements. -* { - box-sizing: border-box; -} +// Document +// +// The default font styles are inherited from the `` element. html { - @include define-type-sizing(); // Change the default font family in all browsers (opinionated). @include typeface(body); - // Prevent adjustments of font size after orientation changes in IE and iOS. + // Correct the line height in all browsers. + @include define-type-sizing(); + // Prevent adjustments of font size after orientation changes in IE on Windows + // Phone and in iOS. -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; // On short pages, we want any background gradients to fill the entire height // of the browser. min-height: 100%; -} -body { - // Output a horizontal grid to help with debugging typography. The - // $typey-debug variable will toggle its output. - @include typey-debug-grid(); - // Remove default margin and padding. - margin: 0; - padding: 0; - color: color(text); - background-color: color(text-bg); -} - -@include respond-to(xxl) { - - html { + @include respond-to(xxl) { @include define-type-sizing($base-font-size-2, $base-line-height-2); } - } diff --git a/sass/base/embedded/_embedded.scss b/sass/base/embedded/_embedded.scss index 23359d0..7675525 100644 --- a/sass/base/embedded/_embedded.scss +++ b/sass/base/embedded/_embedded.scss @@ -1,19 +1,26 @@ // Embedded content // // Weight: 2 -// -// Style guide: base.embedded + +// Audio + +audio { + // Add the correct display in IE 9-. + display: inline-block; +} + +// Add the correct display in iOS 4-7. +audio:not([controls]) { + display: none; + height: 0; +} // Image // // An `` element represents an image. -// -// Markup: embedded-img.twig -// -// Style guide: base.embedded.img img { - // Remove the border on images inside links in IE <11. + // Remove the border on images inside links in IE 10-. border-style: none; } @@ -30,12 +37,15 @@ svg { // Scalable vector // // A `` element represents an image encoded as a Scalable Vector Graphic. -// -// Markup: embedded-svg.twig -// -// Style guide: base.embedded.svg svg:not(:root) { // Hide the overflow in IE. overflow: hidden; } + +// Video + +video { + // Add the correct display in IE 9-. + display: inline-block; +} diff --git a/sass/base/forms/_forms.scss b/sass/base/forms/_forms.scss index 2133b7d..1befcc6 100644 --- a/sass/base/forms/_forms.scss +++ b/sass/base/forms/_forms.scss @@ -8,8 +8,6 @@ // to an HTML form element, these styles will be the ones displayed. // // Weight: -1 -// -// Style guide: forms.base // // The following rules are from normalize.css and help to fix inconsistencies @@ -22,11 +20,13 @@ 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%; - // Change font properties to `inherit` in all browsers (opinionated). - font: inherit; // Remove the margin in Firefox and Safari. margin: 0; } @@ -59,19 +59,13 @@ input { // Correct the outline style in Safari. outline-offset: -2px; - // Remove the inner padding and cancel buttons in Chrome and Safari on OS X. + // Remove the inner padding and cancel buttons in Chrome and Safari on macOS. &::-webkit-search-cancel-button, &::-webkit-search-decoration { -webkit-appearance: none; } } -// Correct the text style of placeholders in Chrome, Edge, and Safari. -::-webkit-input-placeholder { - color: inherit; - opacity: .54; -} - ::-webkit-file-upload-button { // Correct the inability to style clickable types in iOS and Safari. -webkit-appearance: button; @@ -79,6 +73,20 @@ input { font: inherit; } +// Buttons +// +// Buttons built with the `