From 98c0d7d41720edc4662ee275b7fb7bf6778cc1a8 Mon Sep 17 00:00:00 2001 From: Guirec Lefort Date: Fri, 6 May 2022 14:51:27 +0200 Subject: [PATCH] Add borders utility classes --- assets/scss/_utils.scss | 1 + assets/scss/utils/_borders.scss | 85 +++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 assets/scss/utils/_borders.scss diff --git a/assets/scss/_utils.scss b/assets/scss/_utils.scss index 2dd0b92..c0cae72 100644 --- a/assets/scss/_utils.scss +++ b/assets/scss/_utils.scss @@ -3,6 +3,7 @@ // -------------------------------------------------------------------------- @use "utils/a11y"; +@use "utils/borders"; @use "utils/colors"; @use "utils/display"; @use "utils/flex"; diff --git a/assets/scss/utils/_borders.scss b/assets/scss/utils/_borders.scss new file mode 100644 index 0000000..b0a168b --- /dev/null +++ b/assets/scss/utils/_borders.scss @@ -0,0 +1,85 @@ +// +// Borders utilities +// ----------------------------------------------------------------------------- + +@use "sass:map"; +@use "../settings" as *; +@use "../tools" as *; + +// Borders properties map +// ----------------------------------------------------------------------------- + +$borders-utilities: ( + "border-width": ( + property: border-width, + class: border, + values: ( + "0": 0, + "1": 1px, + "2": 2px, + ), + ), + "border-top-width": ( + property: border-top-width, + class: border-t, + values: ( + "0": 0, + "1": 1px, + "2": 2px, + ), + ), + "border-right-width": ( + property: border-right-width, + class: border-r, + values: ( + "0": 0, + "1": 1px, + "2": 2px, + ), + ), + "border-bottom-width": ( + property: border-bottom-width, + class: border-b, + values: ( + "0": 0, + "1": 1px, + "2": 2px, + ), + ), + "border-left-width": ( + property: border-left-width, + class: border-l, + values: ( + "0": 0, + "1": 1px, + "2": 2px, + ), + ), + "border-color": ( + property: border-color, + class: border, + values: + map.merge( + $color-map, + ( + "current": currentColor, + ) + ), + ), + "border-style": ( + property: border-style, + class: border, + values: ( + "solid": solid, + "dashed": dashed, + "dotted": dotted, + "none": none, + ), + responsive: true, + ), +); + +// Generate utilities +// ----------------------------------------------------------------------------- + +@include generate-utilities($borders-utilities);