From 3182e3088fe33d646c1a4d885263ace5cce8be51 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 19 Jul 2019 10:27:01 +0200 Subject: [PATCH] variable $wordpress --- changelog.md | 5 +++-- sass/abstracts/_variables.scss | 5 ++++- sass/knacss.scss | 16 ++++++++++++---- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index 79f87e4..7e7fbdc 100644 --- a/changelog.md +++ b/changelog.md @@ -3,9 +3,10 @@ ## Changelog v8.0.0 (xxx 2019) - mise à jour du reset, suppression des reset vendors (reboot) -- ajout d'une variable pour supporter ou non IE10/IE11 : `$ie: true !default;` -- corrections typo - support passé de IE10 à IE11 (browserlist) +- ajout d'une variable pour supporter ou non IE11 : `$ie: true !default;`. Activation de Grid Layout ou flexbox selon cette variable +- ajout d'une variable pour supporter ou non WordPress : `$wordpress: false !default;`. Activation de reset et styles WordPress selon cette variable +- corrections typo - renommage de dossiers à la "7-1 pattern": `_config` > `abstracts`, `_library` > `base`, et du fichier `_base.scss` en `_reset.scss` - Browserslist devenu `.browserslistrc` diff --git a/sass/abstracts/_variables.scss b/sass/abstracts/_variables.scss index e9ba18e..d165c68 100644 --- a/sass/abstracts/_variables.scss +++ b/sass/abstracts/_variables.scss @@ -75,7 +75,10 @@ $weight-bold : 700 !default; // Activate hyphenation on small screens $hyphens: false !default; -// Activate IE10-IE11 fixes +// Activate WordPress reset and styles +$wordpress: false !default; + +// Activate IE10-IE11 fixes and old grid system $ie: true !default; // ------------ diff --git a/sass/knacss.scss b/sass/knacss.scss index b41029b..0a5f132 100644 --- a/sass/knacss.scss +++ b/sass/knacss.scss @@ -42,11 +42,19 @@ @import "base/layout"; // alignment, modules, positionning @import "base/utilities"; // width and spacer helpers @import "base/responsive"; // Responsive Web Design helpers -// @import "base/wordpress"; // WordPress reset and basic styles -// New Grid System by default (Grid Layout). If you prefer old "Flexbox" Grid System, replace file with "base/grillade-flex" -// Note that none of these files are prefixed by an underscore, in order to compile them. -@import "base/grillade-grid"; // grid system with Grid Layout +// WordPress reset and basics (loaded if $wordpress variable is true). +@if variable-exists(wordpress) and $wordpress==true { + @import "base/wordpress"; // WordPress reset and basic styles +} + +// Grid System (Grid Layout chosen if $ie variable is true). +@if variable-exists(ie) and $ie==true { + @import "base/grillade-flex"; // grid system with Flexbox (old version) + +} @else { + @import "base/grillade-grid"; // grid system with Grid Layout +} // Components @import "components/alerts"; // alerts styles