From 5e2696d9ae35b37a9f7d0fe1c52b93fb84570464 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 25 Mar 2022 18:29:21 +0100 Subject: Split demo in :target views --- src_demo/_base.scss | 5 +++++ src_demo/components/_box.scss | 16 ++++++++++++++++ src_demo/components/_content.scss | 7 +++++++ src_demo/components/_sidebar.scss | 29 +++++++++++++++++++++++++++++ src_demo/components/_view.scss | 12 ++++++++++++ src_demo/index.scss | 17 +++++++++++++++++ 6 files changed, 86 insertions(+) create mode 100644 src_demo/_base.scss create mode 100644 src_demo/components/_box.scss create mode 100644 src_demo/components/_content.scss create mode 100644 src_demo/components/_sidebar.scss create mode 100644 src_demo/components/_view.scss create mode 100644 src_demo/index.scss (limited to 'src_demo') diff --git a/src_demo/_base.scss b/src_demo/_base.scss new file mode 100644 index 0000000..8dcd789 --- /dev/null +++ b/src_demo/_base.scss @@ -0,0 +1,5 @@ +body { + display: grid; + grid-template-columns: auto 1fr; + grid-template-areas: 'sidebar content'; +} diff --git a/src_demo/components/_box.scss b/src_demo/components/_box.scss new file mode 100644 index 0000000..e983f2c --- /dev/null +++ b/src_demo/components/_box.scss @@ -0,0 +1,16 @@ +@use 'iro-sass/src/index' as iro; +@use '../../src/functions' as fn; + +@include iro.props-namespace('box') { + @include iro.props-store(( + --colors: ( + --border: fn.global-color(--obj), + ), + ), 'colors'); + + @include iro.bem-component(iro.props-namespace()) { + margin: 2em 0; + padding: 2em; + border: 1px solid fn.color(--border); + } +} diff --git a/src_demo/components/_content.scss b/src_demo/components/_content.scss new file mode 100644 index 0000000..6045e4b --- /dev/null +++ b/src_demo/components/_content.scss @@ -0,0 +1,7 @@ +@use 'iro-sass/src/index' as iro; + +@include iro.props-namespace('content') { + @include iro.bem-component(iro.props-namespace()) { + grid-area: content; + } +} diff --git a/src_demo/components/_sidebar.scss b/src_demo/components/_sidebar.scss new file mode 100644 index 0000000..9cff3c8 --- /dev/null +++ b/src_demo/components/_sidebar.scss @@ -0,0 +1,29 @@ +@use 'iro-sass/src/index' as iro; +@use '../../src/functions' as fn; + +@include iro.props-namespace('sidebar') { + @include iro.props-store(( + --colors: ( + --bg: fn.global-color(--bg), + --border: fn.global-color(--obj), + --icon: fn.global-color(--fg-hi), + --group-header-fg: fn.global-color(--fg-hi), + ), + ), 'colors'); + + @include iro.props-store(( + --colors: ( + --bg: fn.global-color(--bg-hi), + --border: fn.global-color(--bg-hi), + ), + ), 'colors-dark'); + + @include iro.bem-component(iro.props-namespace()) { + grid-area: sidebar; + min-width: 10em; + padding: .6em; + overflow: auto; + border-right: 1px solid fn.color(--border); + background-color: fn.color(--bg); + } +} diff --git a/src_demo/components/_view.scss b/src_demo/components/_view.scss new file mode 100644 index 0000000..8086280 --- /dev/null +++ b/src_demo/components/_view.scss @@ -0,0 +1,12 @@ +@use 'iro-sass/src/index' as iro; +@use '../../src/functions' as fn; + +@include iro.props-namespace('view') { + @include iro.bem-component(iro.props-namespace()) { + display: none; + + &:target { + display: block; + } + } +} diff --git a/src_demo/index.scss b/src_demo/index.scss new file mode 100644 index 0000000..2a442bd --- /dev/null +++ b/src_demo/index.scss @@ -0,0 +1,17 @@ +@use '../src/declare-vars'; + +@use '../src/base'; +@use 'base' as demo-base; + +@use 'components/sidebar'; +@use 'components/content'; +@use 'components/box'; +@use 'components/view'; + +@use '../src/layouts'; +@use '../src/objects'; +@use '../src/scopes'; +@use '../src/utils'; + +@use '../src/apply-vars'; + -- cgit v1.2.3-70-g09d2