From 98c7f824e80eeeb4344d3c528d54f639ec4158ce Mon Sep 17 00:00:00 2001 From: Volpeon Date: Mon, 28 Feb 2022 14:03:13 +0100 Subject: Added badge --- src/_objects.scss | 1 + src/objects/_badge.scss | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/objects/_badge.scss (limited to 'src') diff --git a/src/_objects.scss b/src/_objects.scss index 1b23d44..4049101 100644 --- a/src/_objects.scss +++ b/src/_objects.scss @@ -1,6 +1,7 @@ @use 'objects/icon'; @use 'objects/heading'; @use 'objects/rule'; +@use 'objects/badge'; @use 'objects/button'; @use 'objects/text-field'; @use 'objects/field-label'; diff --git a/src/objects/_badge.scss b/src/objects/_badge.scss new file mode 100644 index 0000000..cb35d39 --- /dev/null +++ b/src/objects/_badge.scss @@ -0,0 +1,41 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('badge') { + @include iro.props-store(( + --dims: ( + --pad-x: fn.global-dim(--size --75), + --pad-y: fn.global-dim(--size --50), + --rounding: 3px, + --font-size: fn.global-dim(--font-size --75), + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --bg: fn.global-color(--obj-hi), + --label: fn.global-color(--fg-lo), + --accent: ( + --bg: fn.global-color(--accent --primary --bg), + --label: fn.global-color(--accent --primary --fg), + ) + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-block; + padding: fn.dim(--pad-y) fn.dim(--pad-x); + border-radius: fn.dim(--rounding); + background-color: fn.color(--bg); + color: fn.color(--label); + font-size: fn.dim(--font-size); + font-weight: 500; + line-height: 1; + text-align: center; + + @include iro.bem-modifier('accent') { + background-color: fn.color(--accent --bg); + color: fn.color(--accent --label); + } + } +} -- cgit v1.2.3-70-g09d2