From 511a47c8964c43927563ee88b62b3f215bf9b7d1 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Mon, 28 Mar 2022 20:25:21 +0200 Subject: Update --- src/objects/_alert.scss | 4 +-- src/objects/_checkbox.scss | 32 ++++++++++----------- src/objects/_dialog.scss | 66 +++++++++++++++++++++++++++++--------------- src/objects/_divider.scss | 12 ++++---- src/objects/_header.scss | 31 --------------------- src/objects/_lightbox.scss | 2 +- src/objects/_radio.scss | 18 ++++++------ src/objects/_sidebar.scss | 36 ------------------------ src/objects/_switch.scss | 18 ++++++------ src/objects/_text-field.scss | 10 +++---- 10 files changed, 91 insertions(+), 138 deletions(-) delete mode 100644 src/objects/_header.scss delete mode 100644 src/objects/_sidebar.scss (limited to 'src/objects') diff --git a/src/objects/_alert.scss b/src/objects/_alert.scss index 0bb8485..3b4656e 100644 --- a/src/objects/_alert.scss +++ b/src/objects/_alert.scss @@ -4,7 +4,7 @@ @include iro.props-namespace('alert') { @include iro.props-store(( --dims: ( - --border-width: 2px, + --border: 2px, --pad-x: fn.global-dim(--size --250), --pad-y: fn.global-dim(--size --250), --rounding: 4px, @@ -24,7 +24,7 @@ @include iro.bem-object(iro.props-namespace()) { padding: fn.dim(--pad-y) fn.dim(--pad-x); - border: fn.dim(--border-width) solid fn.color(--border); + border: fn.dim(--border) solid fn.color(--border); border-radius: fn.dim(--rounding); background-color: fn.color(--bg); color: fn.global-color(--fg); diff --git a/src/objects/_checkbox.scss b/src/objects/_checkbox.scss index 412efda..5443354 100644 --- a/src/objects/_checkbox.scss +++ b/src/objects/_checkbox.scss @@ -4,11 +4,11 @@ @include iro.props-namespace('checkbox') { @include iro.props-store(( --dims: ( - --size: fn.global-dim(--size --175), - --label-gap: fn.global-dim(--size --125), - --border-width: fn.global-dim(--border-width --medium), - --pad-x: fn.global-dim(--size --65), - --pad-y: fn.global-dim(--size --65), + --size: fn.global-dim(--size --175), + --label-gap: fn.global-dim(--size --125), + --border: fn.global-dim(--border --medium), + --pad-x: fn.global-dim(--size --65), + --pad-y: fn.global-dim(--size --65), ), ), 'dims'); @@ -56,7 +56,7 @@ width: fn.dim(--size); height: fn.dim(--size); margin-top: calc(.5 * (fn.global-dim(--font --standard --line-height) * 1em - fn.dim(--size))); - border-radius: fn.dim(--border-width); + border-radius: fn.dim(--border); background-color: fn.color(--box-border); &::before, @@ -68,10 +68,10 @@ &::before { z-index: 2; - top: fn.dim(--border-width); - left: fn.dim(--border-width); - width: calc(fn.dim(--size) - 2 * fn.dim(--border-width)); - height: calc(fn.dim(--size) - 2 * fn.dim(--border-width)); + top: fn.dim(--border); + left: fn.dim(--border); + width: calc(fn.dim(--size) - 2 * fn.dim(--border)); + height: calc(fn.dim(--size) - 2 * fn.dim(--border)); transition: transform .2s ease; background-color: fn.color(--box-bg); } @@ -79,9 +79,9 @@ &::after { z-index: 3; top: calc(.5 * fn.dim(--size) - 1px); - left: calc(1.5 * fn.dim(--border-width)); + left: calc(1.5 * fn.dim(--border)); box-sizing: border-box; - width: calc(fn.dim(--size) - 3 * fn.dim(--border-width)); + width: calc(fn.dim(--size) - 3 * fn.dim(--border)); height: 0; transform: scale(0); transition: transform .2s ease; @@ -96,10 +96,10 @@ display: block; position: absolute; z-index: 2; - top: calc(1 * fn.dim(--border-width)); - left: calc(1 * fn.dim(--border-width)); - width: calc(100% - 2 * fn.dim(--border-width)); - height: calc(100% - 2 * fn.dim(--border-width)); + top: calc(1 * fn.dim(--border)); + left: calc(1 * fn.dim(--border)); + width: calc(100% - 2 * fn.dim(--border)); + height: calc(100% - 2 * fn.dim(--border)); transform: scale(0); transform-origin: 40% 90%; transition: transform .2s ease; diff --git a/src/objects/_dialog.scss b/src/objects/_dialog.scss index 094e09b..ac77a66 100644 --- a/src/objects/_dialog.scss +++ b/src/objects/_dialog.scss @@ -1,8 +1,6 @@ @use 'iro-sass/src/index' as iro; @use '../functions' as fn; -@use 'header'; - @include iro.props-namespace('dialog') { @include iro.props-store(( --dims: ( @@ -12,6 +10,16 @@ --rounding: 8px, --border: 1px, + --header: ( + --pad-x: fn.global-dim(--size --75), + --pad-y: fn.global-dim(--size --75), + ), + + --sidebar: ( + --pad-x: fn.global-dim(--size --75), + --pad-y: fn.global-dim(--size --75), + ), + --body: ( --pad-x: fn.global-dim(--size --200), --pad-y: fn.global-dim(--size --200), @@ -28,18 +36,15 @@ @include iro.props-store(( --colors: ( - --border: rgba(#000, .2), - --shadow: 0 .2em .5em rgba(#000, .2), - - --sidebar: ( - --border: fn.global-color(--obj), - ), + --outer-border: rgba(#000, .2), + --inner-border: fn.global-color(--obj), + --shadow: 0 .2em .5em rgba(#000, .2), ), ), 'colors'); @include iro.props-store(( --colors: ( - --border: rgba(#fff, .2), + --outer-border: rgba(#fff, .2), ), ), 'colors-dark'); @@ -57,7 +62,7 @@ max-width: fn.dim(--width-md); margin: 0 auto; overflow: hidden; - border: fn.dim(--border) solid fn.color(--border); + border: fn.dim(--border) solid fn.color(--outer-border); border-radius: fn.dim(--rounding); background-clip: padding-box; background-color: fn.global-color(--bg); @@ -72,29 +77,34 @@ max-width: fn.dim(--width-lg); } - @include iro.bem-elem('sidebar-header') { - grid-area: sidebar-header; - border-right: 1px solid fn.color(--sidebar --border); - - @include iro.bem-sibling-elem('header') { - grid-area: header; + @include iro.bem-elem('header') { + grid-area: sidebar-header / sidebar-header / header / header; + padding: fn.dim(--header --pad-y) fn.dim(--header --pad-x); + border-bottom: 1px solid fn.color(--inner-border); + + @include iro.bem-modifier('sidebar') { + grid-area: sidebar-header; + border-right: 1px solid fn.color(--inner-border); + + @include iro.bem-sibling-elem('header') { + grid-area: header; + } } } - @include iro.bem-elem('header') { - grid-area: sidebar-header / sidebar-header / header / header; + @include iro.bem-elem('title') { + padding-right: calc(fn.dim(--body --pad-x) - fn.dim(--header --pad-x)); + padding-left: calc(fn.dim(--body --pad-x) - fn.dim(--header --pad-x)); } @include iro.bem-elem('close-btn') { margin-left: auto; } - @include iro.bem-elem('label') { - padding: 0 calc(fn.dim(--body --pad-x) - fn.foreign-dim(--header, --pad-x)); - } - @include iro.bem-elem('sidebar') { - grid-area: sidebar; + grid-area: sidebar; + padding: fn.dim(--sidebar --pad-y) fn.dim(--sidebar --pad-x); + border-right: 1px solid fn.color(--inner-border); } @include iro.bem-elem('body') { @@ -108,5 +118,15 @@ justify-content: flex-end; padding: fn.dim(--body --pad-y) fn.dim(--body --pad-x); } + + @include iro.bem-modifier('flat') { + @include iro.bem-elem('header') { + border-bottom: 0; + } + + @include iro.bem-elem('body') { + padding-top: 0; + } + } } } diff --git a/src/objects/_divider.scss b/src/objects/_divider.scss index cef598f..9764ddb 100644 --- a/src/objects/_divider.scss +++ b/src/objects/_divider.scss @@ -7,15 +7,15 @@ --margin-y: fn.global-dim(--size --85), --strong: ( - --border-width: fn.global-dim(--border-width --thick), + --border: fn.global-dim(--border --thick), --label-font-size: fn.global-dim(--font-size --100), ), --medium: ( - --border-width: fn.global-dim(--border-width --medium), + --border: fn.global-dim(--border --medium), --label-font-size: fn.global-dim(--font-size --75), ), --faint: ( - --border-width: fn.global-dim(--border-width --thin), + --border: fn.global-dim(--border --thin), --label-font-size: fn.global-dim(--font-size --50), ), ), @@ -40,7 +40,7 @@ @include iro.bem-object(iro.props-namespace()) { display: block; - height: fn.dim(--strong --border-width); + height: fn.dim(--strong --border); margin-top: fn.dim(--margin-y); margin-bottom: fn.dim(--margin-y); background-color: fn.color(--strong --bg); @@ -55,12 +55,12 @@ } @include iro.bem-modifier('medium') { - height: fn.dim(--medium --border-width); + height: fn.dim(--medium --border); background-color: fn.color(--medium --bg); } @include iro.bem-modifier('faint') { - height: fn.dim(--faint --border-width); + height: fn.dim(--faint --border); background-color: fn.color(--faint --bg); } diff --git a/src/objects/_header.scss b/src/objects/_header.scss deleted file mode 100644 index 773d584..0000000 --- a/src/objects/_header.scss +++ /dev/null @@ -1,31 +0,0 @@ -@use 'iro-sass/src/index' as iro; -@use '../functions' as fn; - -@include iro.props-namespace('header') { - @include iro.props-store(( - --dims: ( - --pad-x: fn.global-dim(--size --75), - --pad-y: fn.global-dim(--size --75) - ), - ), 'dims'); - - @include iro.props-store(( - --colors: ( - --border: fn.global-color(--obj), - ), - ), 'colors'); - - @include iro.bem-object(iro.props-namespace()) { - border-bottom: 1px solid fn.color(--border); - - @include iro.bem-elem('content') { - display: flex; - box-sizing: border-box; - align-items: center; - height: 100%; - padding: fn.dim(--pad-y) fn.dim(--pad-x); - background-color: fn.global-color(--bg); - color: fn.global-color(--fg); - } - } -} diff --git a/src/objects/_lightbox.scss b/src/objects/_lightbox.scss index 435ff88..131db29 100644 --- a/src/objects/_lightbox.scss +++ b/src/objects/_lightbox.scss @@ -12,7 +12,7 @@ --thumbnail: ( --size: fn.global-dim(--size --800), --spacing: fn.global-dim(--size --100), - --selected: 2px, //fn.global-dim(--border-width --medium), + --selected: 2px, //fn.global-dim(--border --medium), ), --button: ( --font-size: fn.global-dim(--font-size --200), diff --git a/src/objects/_radio.scss b/src/objects/_radio.scss index c740833..65dfa66 100644 --- a/src/objects/_radio.scss +++ b/src/objects/_radio.scss @@ -4,11 +4,11 @@ @include iro.props-namespace('radio') { @include iro.props-store(( --dims: ( - --diameter: calc(fn.global-dim(--size --175) + 1px), - --label-gap: fn.global-dim(--size --125), - --border-width: fn.global-dim(--border-width --medium), - --pad-x: fn.global-dim(--size --65), - --pad-y: fn.global-dim(--size --65), + --diameter: calc(fn.global-dim(--size --175) + 1px), + --label-gap: fn.global-dim(--size --125), + --border: fn.global-dim(--border --medium), + --pad-x: fn.global-dim(--size --65), + --pad-y: fn.global-dim(--size --65), ), ), 'dims'); @@ -63,10 +63,10 @@ content: ''; display: block; position: relative; - top: fn.dim(--border-width); - left: fn.dim(--border-width); - width: calc(fn.dim(--diameter) - 2 * fn.dim(--border-width)); - height: calc(fn.dim(--diameter) - 2 * fn.dim(--border-width)); + top: fn.dim(--border); + left: fn.dim(--border); + width: calc(fn.dim(--diameter) - 2 * fn.dim(--border)); + height: calc(fn.dim(--diameter) - 2 * fn.dim(--border)); transition: transform .2s ease; border-radius: fn.dim(--diameter); background-color: fn.color(--circle-bg); diff --git a/src/objects/_sidebar.scss b/src/objects/_sidebar.scss deleted file mode 100644 index bf8dd59..0000000 --- a/src/objects/_sidebar.scss +++ /dev/null @@ -1,36 +0,0 @@ -@use 'iro-sass/src/index' as iro; -@use '../functions' as fn; - -@include iro.props-namespace('sidebar') { - @include iro.props-store(( - --dims: ( - --pad-x: fn.global-dim(--size --75), - --pad-y: fn.global-dim(--size --75) - ), - ), 'dims'); - - @include iro.props-store(( - --colors: ( - --border: fn.global-color(--obj), - ), - ), 'colors'); - - @include iro.bem-object(iro.props-namespace()) { - border-width: 0 1px 0 0; - border-style: solid; - border-color: fn.color(--border); - - @include iro.bem-elem('content') { - box-sizing: border-box; - height: 100%; - padding: fn.dim(--pad-y) fn.dim(--pad-x); - background-color: fn.global-color(--bg); - color: fn.global-color(--fg); - } - - @include iro.bem-modifier('right') { - border-right-width: 0; - border-left-width: 1px; - } - } -} diff --git a/src/objects/_switch.scss b/src/objects/_switch.scss index a818bde..ad39115 100644 --- a/src/objects/_switch.scss +++ b/src/objects/_switch.scss @@ -4,12 +4,12 @@ @include iro.props-namespace('switch') { @include iro.props-store(( --dims: ( - --width: fn.global-dim(--size --325), - --height: calc(fn.global-dim(--size --175) + 1px), - --label-gap: fn.global-dim(--size --125), - --border-width: fn.global-dim(--border-width --medium), - --pad-x: fn.global-dim(--size --65), - --pad-y: fn.global-dim(--size --65), + --width: fn.global-dim(--size --325), + --height: calc(fn.global-dim(--size --175) + 1px), + --label-gap: fn.global-dim(--size --125), + --border: fn.global-dim(--border --medium), + --pad-x: fn.global-dim(--size --65), + --pad-y: fn.global-dim(--size --65), ), ), 'dims'); @@ -67,10 +67,10 @@ &::after { content: ''; display: block; - width: calc(fn.dim(--height) - 2 * fn.dim(--border-width)); - height: calc(fn.dim(--height) - 2 * fn.dim(--border-width)); + width: calc(fn.dim(--height) - 2 * fn.dim(--border)); + height: calc(fn.dim(--height) - 2 * fn.dim(--border)); transition: transform .2s ease; - border: fn.dim(--border-width) solid fn.color(--handle-border); + border: fn.dim(--border) solid fn.color(--handle-border); border-radius: fn.dim(--width); background-color: fn.color(--handle-bg); } diff --git a/src/objects/_text-field.scss b/src/objects/_text-field.scss index 1e18f0a..643e8d9 100644 --- a/src/objects/_text-field.scss +++ b/src/objects/_text-field.scss @@ -34,7 +34,7 @@ --dims: ( --pad-x: fn.global-dim(--size --125), --pad-y: fn.global-dim(--size --125), - --border-width: fn.global-dim(--border-width --thin), + --border: fn.global-dim(--border --thin), --border-radius: 2px, --extended: ( @@ -43,7 +43,7 @@ ), --focus: ( - --border-width: fn.global-dim(--border-width --medium), + --border: fn.global-dim(--border --medium), ) ), ), 'dims'); @@ -93,7 +93,7 @@ @include iro.bem-object(iro.props-namespace()) { $line-height: 1.4; - $focus-border-offset: calc(fn.dim(--border-width) - fn.dim(--focus --border-width)); + $focus-border-offset: calc(fn.dim(--border) - fn.dim(--focus --border)); position: relative; min-width: 0; @@ -107,7 +107,7 @@ right: 0; bottom: 0; left: 0; - border: fn.dim(--border-width) solid fn.color(--border); + border: fn.dim(--border) solid fn.color(--border); border-radius: fn.dim(--border-radius); box-shadow: fn.color(--shadow); pointer-events: none; @@ -143,7 +143,7 @@ right: $focus-border-offset; bottom: $focus-border-offset; left: $focus-border-offset; - border: fn.dim(--focus --border-width) solid fn.color(--focus --border); + border: fn.dim(--focus --border) solid fn.color(--focus --border); border-radius: calc(fn.dim(--border-radius) - $focus-border-offset); box-shadow: fn.color(--focus --shadow); } -- cgit v1.2.3-70-g09d2