From 69d753931c098bc18cd23e96af18f736a772f416 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 22 Jun 2024 23:00:16 +0200 Subject: Update --- src/.old/objects/_field-label.scss | 89 -------------- src/.old/objects/_text-field.scss | 232 ------------------------------------- src/_objects.scss | 4 +- src/objects/_badge.scss | 8 +- src/objects/_button.scss | 30 ++++- src/objects/_field-label.scss | 86 ++++++++++++++ src/objects/_text-field.scss | 209 +++++++++++++++++++++++++++++++++ tpl/objects/button.pug | 5 +- tpl/objects/field-label.pug | 13 ++- tpl/objects/text-field.pug | 6 +- tpl/views/badge.pug | 48 ++++---- tpl/views/button.pug | 33 ++++++ tpl/views/field-label.pug | 24 ++-- 13 files changed, 410 insertions(+), 377 deletions(-) delete mode 100644 src/.old/objects/_field-label.scss delete mode 100644 src/.old/objects/_text-field.scss create mode 100644 src/objects/_field-label.scss create mode 100644 src/objects/_text-field.scss diff --git a/src/.old/objects/_field-label.scss b/src/.old/objects/_field-label.scss deleted file mode 100644 index 2127a09..0000000 --- a/src/.old/objects/_field-label.scss +++ /dev/null @@ -1,89 +0,0 @@ -@use 'iro-sass/src/index' as iro; -@use '../functions' as fn; - -@include iro.props-namespace('field-label') { - @include iro.props-store(( - --dims: ( - --spacing-x: fn.global-dim(--size --150), - --spacing-y: fn.global-dim(--size --85), - --label-font-size: fn.global-dim(--font-size --75), - --hint-font-size: fn.global-dim(--font-size --75), - ), - ), 'dims'); - - @include iro.props-store(( - --colors: ( - --label: fn.global-color(--fg-hi), - --hint: fn.global-color(--fg-hi), - --error-hint: fn.global-color(--accent --error --quiet --fg), - --disabled: fn.global-color(--fg-hi3), - ), - ), 'colors'); - - @include iro.bem-object(iro.props-namespace()) { - display: block; - - @include iro.bem-elem('label') { - display: block; - flex: 0 0 auto; - padding-right: fn.dim(--spacing-x); - color: fn.color(--label); - font-size: fn.dim(--label-font-size); - font-weight: 400; - line-height: 1.3; - - @include iro.bem-next-elem('content') { - margin-top: fn.dim(--spacing-y); - } - } - - @include iro.bem-elem('content') { - display: block; - width: 100%; - } - - @include iro.bem-elem('hint') { - display: block; - margin-top: fn.dim(--spacing-y); - color: fn.color(--hint); - font-size: fn.dim(--hint-font-size); - } - - @include iro.bem-is('invalid') { - @include iro.bem-elem('hint') { - color: fn.color(--error-hint); - } - } - - @include iro.bem-is('disabled') { - @include iro.bem-elem('label', 'hint') { - color: fn.color(--disabled); - } - } - - @include iro.bem-modifier('left', 'right') { - display: flex; - align-items: baseline; - - @include iro.bem-elem('label') { - display: inline-block; - - @include iro.bem-next-elem('content') { - margin-top: 0; - } - } - } - - @include iro.bem-modifier('left') { - @include iro.bem-elem('label') { - text-align: left; - } - } - - @include iro.bem-modifier('right') { - @include iro.bem-elem('label') { - text-align: right; - } - } - } -} diff --git a/src/.old/objects/_text-field.scss b/src/.old/objects/_text-field.scss deleted file mode 100644 index 88c4535..0000000 --- a/src/.old/objects/_text-field.scss +++ /dev/null @@ -1,232 +0,0 @@ -@use 'iro-sass/src/index' as iro; -@use '../functions' as fn; - -@mixin invalid { - @include iro.bem-sibling-elem('bg') { - border-color: fn.color(--error --border); - box-shadow: fn.color(--error --shadow); - } - - &:hover { - @include iro.bem-sibling-elem('bg') { - border-color: fn.color(--error --hover --border); - box-shadow: fn.color(--error --hover --shadow); - } - } - - &:focus { - @include iro.bem-sibling-elem('bg') { - border-color: fn.color(--error --focus --border); - box-shadow: fn.color(--error --focus --shadow); - } - } -} - -@mixin keyboard-focus { - @include iro.bem-sibling-elem('bg') { - border-color: fn.color(--key-focus --border); - box-shadow: fn.color(--key-focus --shadow); - } -} - -@include iro.props-namespace('text-field') { - @include iro.props-store(( - --dims: ( - --pad-x: fn.global-dim(--size --125), - --pad-y: fn.global-dim(--size --125), - --border: fn.global-dim(--border --thin), - --rounding: 2px, - - --extended: ( - --pad: fn.global-dim(--size --50), - --rounding: 6px, - ), - - --focus: ( - --border: fn.global-dim(--border --medium), - ) - ), - ), 'dims'); - - @include iro.props-store(( - --colors: ( - --bg: fn.global-color(--bg-hi2), - --placeholder: fn.global-color(--fg-hi2), - --text: fn.global-color(--fg), - --border: fn.global-color(--obj-lo), - --shadow: 0 0 0 0 transparent, - - --hover: ( - --border: fn.global-color(--fg-hi2), - --shadow: 0 0 0 0 transparent, - ), - --focus: ( - --border: fn.global-color(--accent --primary --solid --bg), - --shadow: 0 0 0 0 transparent, - ), - --key-focus: ( - --border: fn.global-color(--focus --fill), - --shadow: fn.global-color(--focus --shadow), - ), - --error: ( - --border: fn.global-color(--accent --error --solid --bg-hi), - --shadow: 0 0 0 0 transparent, - - --hover: ( - --border: fn.global-color(--accent --error --solid --bg), - --shadow: 0 0 0 0 transparent, - ), - --focus: ( - --border: fn.global-color(--accent --error --solid --bg), - --shadow: 0 0 0 0 transparent, - ), - ), - --disabled: ( - --bg: fn.global-color(--obj-hi), - --placeholder: fn.global-color(--fg-hi3), - --text: fn.global-color(--fg-hi3), - --border: fn.global-color(--obj-hi), - --shadow: 0 0 0 0 transparent, - ), - ), - ), 'colors'); - - @include iro.bem-object(iro.props-namespace()) { - $line-height: 1.4; - $focus-border-offset: calc(fn.dim(--border) - fn.dim(--focus --border)); - - position: relative; - min-width: 0; - border-radius: fn.dim(--rounding); - background-color: fn.color(--bg); - - @include iro.bem-elem('bg') { - display: block; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - border: fn.dim(--border) solid fn.color(--border); - border-radius: fn.dim(--rounding); - box-shadow: fn.color(--shadow); - pointer-events: none; - } - - @include iro.bem-elem('native') { - box-sizing: border-box; - width: 100%; - padding: calc(fn.dim(--pad-y) - .5em * ($line-height - 1)) fn.dim(--pad-x); - border: 1px solid transparent; - background-color: transparent; - color: fn.color(--text); - font: inherit; - line-height: $line-height; - resize: none; - appearance: none; - - &::placeholder { - opacity: 1; - color: fn.color(--placeholder); - font-style: italic; - } - - &:hover { - @include iro.bem-sibling-elem('bg') { - border-color: fn.color(--hover --border); - box-shadow: fn.color(--hover --shadow); - } - } - - &:focus { - outline: 0; - - @include iro.bem-sibling-elem('bg') { - top: $focus-border-offset; - right: $focus-border-offset; - bottom: $focus-border-offset; - left: $focus-border-offset; - border: fn.dim(--focus --border) solid fn.color(--focus --border); - border-radius: calc(fn.dim(--rounding) - $focus-border-offset); - box-shadow: fn.color(--focus --shadow); - } - } - - &:invalid { - @include invalid; - } - } - - @include iro.bem-modifier('extended') { - padding: fn.dim(--extended --pad); - - @include iro.bem-multi('&', 'elem' 'bg') { - border-radius: calc(fn.dim(--rounding) + fn.dim(--extended --pad)); - } - - @include iro.bem-elem('native') { - &:focus { - @include iro.bem-sibling-elem('bg') { - border-radius: calc(fn.dim(--extended --rounding) - $focus-border-offset); - } - } - } - } - - @include iro.bem-is('invalid') { - @include iro.bem-elem('native') { - @include invalid; - } - } - - @include iro.bem-at-theme('keyboard') { - @include iro.bem-elem('native') { - &:focus, - &:invalid:focus { - @include keyboard-focus; - } - } - - @include iro.bem-is('invalid') { - @include iro.bem-elem('native') { - &:focus { - @include keyboard-focus; - } - } - } - } - - @include iro.bem-is('disabled') { - background-color: fn.color(--disabled --bg); - box-shadow: fn.color(--disabled --shadow); - - @include iro.bem-elem('native') { - color: fn.color(--disabled --text); - - &::placeholder { - color: fn.color(--disabled --placeholder); - } - } - - @include iro.bem-elem('bg') { - border-color: fn.color(--disabled --border); - } - - @include iro.bem-is('invalid') { - @include iro.bem-elem('native') { - @include iro.bem-sibling-elem('bg') { - border-color: fn.color(--disabled --border); - } - } - } - - @include iro.bem-elem('native') { - &:invalid { - @include iro.bem-sibling-elem('bg') { - border-color: fn.color(--disabled --border); - } - } - } - } - } -} diff --git a/src/_objects.scss b/src/_objects.scss index 68bf3a7..3dd5176 100644 --- a/src/_objects.scss +++ b/src/_objects.scss @@ -4,8 +4,8 @@ @use 'objects/divider'; @use 'objects/badge'; @use 'objects/button'; -// @use 'objects/text-field'; -// @use 'objects/field-label'; +@use 'objects/text-field'; +@use 'objects/field-label'; // @use 'objects/radio'; // @use 'objects/checkbox'; // @use 'objects/switch'; diff --git a/src/objects/_badge.scss b/src/objects/_badge.scss index 0d95751..23ae305 100644 --- a/src/objects/_badge.scss +++ b/src/objects/_badge.scss @@ -12,19 +12,19 @@ $themes: accent positive negative warning; --rounding: fn.global-dim(--rounding), --font-size: fn.global-dim(--font-size --100), - --50: ( + --sm: ( --pad-b: fn.global-dim(--size --50), --pad-i: fn.global-dim(--size --115), --pad-i-pill: fn.global-dim(--size --150), --font-size: fn.global-dim(--font-size --75), ), - --200: ( + --lg: ( --pad-b: fn.global-dim(--size --125), --pad-i: fn.global-dim(--size --175), --pad-i-pill: fn.global-dim(--size --225), --font-size: fn.global-dim(--font-size --150), ), - --300: ( + --xl: ( --pad-b: fn.global-dim(--size --160), --pad-i: fn.global-dim(--size --225), --pad-i-pill: fn.global-dim(--size --300), @@ -179,7 +179,7 @@ $themes: accent positive negative warning; border-radius: 10em; } - @each $size in '50' '200' '300' { + @each $size in sm lg xl { @include iro.bem-modifier($size) { padding-block: fn.dim(--#{$size} --pad-b); padding-inline: fn.dim(--#{$size} --pad-i); diff --git a/src/objects/_button.scss b/src/objects/_button.scss index d3588f6..a823f17 100644 --- a/src/objects/_button.scss +++ b/src/objects/_button.scss @@ -47,11 +47,24 @@ $themes: primary accent positive negative warning; --line-height: 1.4, --pad-i: fn.global-dim(--size --225), --pad-b: fn.global-dim(--size --65), + --border: fn.global-dim(--border --medium), --rounding: 10em, + --font-size: fn.global-dim(--font-size --100), + --sm: ( + --pad-i: fn.global-dim(--size --150), + --pad-b: fn.global-dim(--size --25), + --font-size: fn.global-dim(--font-size --75), + ), --lg: ( - --pad-i: fn.global-dim(--size --300), - --pad-b: fn.global-dim(--size --100), + --pad-i: fn.global-dim(--size --300), + --pad-b: fn.global-dim(--size --100), + --font-size: fn.global-dim(--font-size --150), + ), + --xl: ( + --pad-i: fn.global-dim(--size --400), + --pad-b: fn.global-dim(--size --150), + --font-size: fn.global-dim(--font-size --200), ), ), --colors: ( @@ -121,11 +134,12 @@ $themes: primary accent positive negative warning; display: inline-block; padding-block: fn.dim(--pad-b); padding-inline: fn.dim(--pad-i); - border: 2px solid transparent; + border: fn.dim(--border) solid transparent; border-radius: fn.dim(--rounding); border-color: fn.color(--disabled --bg); background-color: fn.color(--disabled --bg); color: fn.color(--disabled --label); + font-size: fn.dim(--font-size); font-weight: 500; line-height: fn.dim(--line-height); text-align: center; @@ -141,9 +155,12 @@ $themes: primary accent positive negative warning; box-shadow: none; } - @include iro.bem-modifier('lg') { - padding-block: fn.dim(--lg --pad-b); - padding-inline: fn.dim(--lg --pad-i); + @each $size in sm lg xl { + @include iro.bem-modifier($size) { + padding-block: fn.dim(--#{$size} --pad-b); + padding-inline: fn.dim(--#{$size} --pad-i); + font-size: fn.dim(--#{$size} --font-size); + } } @include button-variant(); @@ -160,6 +177,7 @@ $themes: primary accent positive negative warning; &:focus-visible { border-color: fn.color(--key-focus --border); background-color: fn.color(--key-focus --bg); + box-shadow: 0 0 0 calc(fn.global-dim(--border --thick) - fn.dim(--border)) fn.color(--key-focus --border); color: fn.color(--key-focus --label); } } diff --git a/src/objects/_field-label.scss b/src/objects/_field-label.scss new file mode 100644 index 0000000..9f267cb --- /dev/null +++ b/src/objects/_field-label.scss @@ -0,0 +1,86 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('field-label') { + @include iro.props-store(( + --dims: ( + --spacing-i: fn.global-dim(--size --150), + --spacing-b: fn.global-dim(--size --85), + --label-font-size: fn.global-dim(--font-size --75), + --hint-font-size: fn.global-dim(--font-size --75), + ), + --colors: ( + --label: fn.global-color(--text-mute), + --hint: fn.global-color(--text-mute), + --error-hint: fn.global-color(--negative --900), + --disabled: fn.global-color(--text-disabled), + ), + )); + + @include iro.bem-object(iro.props-namespace()) { + display: block; + + @include iro.bem-elem('label') { + display: block; + flex: 0 0 auto; + padding-inline-end: fn.dim(--spacing-i); + color: fn.color(--label); + font-size: fn.dim(--label-font-size); + font-weight: 400; + line-height: 1.3; + + @include iro.bem-next-elem('content') { + margin-block-start: fn.dim(--spacing-b); + } + } + + @include iro.bem-elem('content') { + display: block; + inline-size: 100%; + } + + @include iro.bem-elem('hint') { + display: block; + margin-block-start: fn.dim(--spacing-b); + color: fn.color(--hint); + font-size: fn.dim(--hint-font-size); + } + + @include iro.bem-is('invalid') { + @include iro.bem-elem('hint') { + color: fn.color(--error-hint); + } + } + + @include iro.bem-is('disabled') { + @include iro.bem-elem('label', 'hint') { + color: fn.color(--disabled); + } + } + + @include iro.bem-modifier('align-start', 'align-end') { + display: flex; + align-items: baseline; + + @include iro.bem-elem('label') { + display: inline-block; + + @include iro.bem-next-elem('content') { + margin-block-start: 0; + } + } + } + + @include iro.bem-modifier('align-start') { + @include iro.bem-elem('label') { + text-align: start; + } + } + + @include iro.bem-modifier('align-end') { + @include iro.bem-elem('label') { + text-align: end; + } + } + } +} diff --git a/src/objects/_text-field.scss b/src/objects/_text-field.scss new file mode 100644 index 0000000..de5bcd1 --- /dev/null +++ b/src/objects/_text-field.scss @@ -0,0 +1,209 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@mixin invalid { + $focus-border-offset: calc(fn.dim(--border) - fn.dim(--focus --border)); + + @include iro.bem-sibling-elem('bg') { + inset-block: $focus-border-offset; + inset-inline: $focus-border-offset; + border: fn.dim(--focus --border) solid fn.color(--error --border); + border-radius: calc(fn.dim(--rounding) - $focus-border-offset); + } + + &:hover { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--error --hover --border); + } + } + + &:focus { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--error --focus --border); + } + } +} + +@mixin keyboard-focus { + @include iro.bem-sibling-elem('bg') { + border: fn.dim(--key-focus --border) solid fn.color(--key-focus --border); + } +} + +@include iro.props-namespace('text-field') { + @include iro.props-store(( + --dims: ( + --line-height: 1.4, + --pad-i: fn.global-dim(--size --125), + --pad-b: fn.global-dim(--size --125), + --border: fn.global-dim(--border --thin), + --rounding: fn.global-dim(--rounding), + + --extended: ( + --pad: fn.global-dim(--size --50), + ), + + --focus: ( + --border: fn.global-dim(--border --medium), + ), + --key-focus: ( + --border: fn.global-dim(--border --thick), + ) + ), + --colors: ( + --bg: fn.global-color(--base --50), + --placeholder: fn.global-color(--text-mute-more), + --text: fn.global-color(--text), + --border: fn.global-color(--border-strong), + + --hover: ( + --border: fn.global-color(--text-mute-more), + ), + --focus: ( + --border: fn.global-color(--accent --900), + ), + --key-focus: ( + --border: fn.global-color(--yellow-static --400), + ), + --error: ( + --border: fn.global-color(--negative --900), + + --hover: ( + --border: fn.global-color(--negative --800), + ), + --focus: ( + --border: fn.global-color(--negative --800), + ), + ), + --disabled: ( + --bg: fn.global-color(--border-mute), + --placeholder: fn.global-color(--text-disabled), + --text: fn.global-color(--text-disabled), + --border: fn.global-color(--border-mute), + ), + ), + )); + + @include iro.bem-object(iro.props-namespace()) { + $focus-border-offset: calc(fn.dim(--border) - fn.dim(--focus --border)); + + position: relative; + min-inline-size: 0; + border-radius: fn.dim(--rounding); + background-color: fn.color(--bg); + + @include iro.bem-elem('bg') { + display: block; + position: absolute; + inset-block: 0; + inset-inline: 0; + border: fn.dim(--border) solid fn.color(--border); + border-radius: fn.dim(--rounding); + pointer-events: none; + } + + @include iro.bem-elem('native') { + box-sizing: border-box; + inline-size: 100%; + padding-block: calc(fn.dim(--pad-b) - .5em * (fn.dim(--line-height) - 1)); + padding-inline: fn.dim(--pad-i); + border: 1px solid transparent; + background-color: transparent; + color: fn.color(--text); + font: inherit; + line-height: fn.dim(--line-height); + resize: none; + appearance: none; + + &::placeholder { + opacity: 1; + color: fn.color(--placeholder); + font-style: italic; + } + + &:hover { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--hover --border); + } + } + + &:focus { + outline: 0; + + @include iro.bem-sibling-elem('bg') { + inset-block: $focus-border-offset; + inset-inline: $focus-border-offset; + border: fn.dim(--focus --border) solid fn.color(--focus --border); + border-radius: calc(fn.dim(--rounding) - $focus-border-offset); + } + } + + &:invalid { + @include invalid; + } + + &:focus-visible, + &:invalid:focus-visible { + @include keyboard-focus; + } + } + + @include iro.bem-modifier('extended') { + padding: fn.dim(--extended --pad); + + @include iro.bem-multi('&', 'elem' 'bg') { + border-radius: calc(fn.dim(--rounding) + fn.dim(--extended --pad)); + } + + @include iro.bem-elem('native') { + &:focus { + @include iro.bem-sibling-elem('bg') { + border-radius: calc(fn.dim(--rounding) + fn.dim(--extended --pad) - $focus-border-offset); + } + } + } + } + + @include iro.bem-is('invalid') { + @include iro.bem-elem('native') { + @include invalid; + + &:focus-visible { + @include keyboard-focus; + } + } + } + + @include iro.bem-is('disabled') { + background-color: fn.color(--disabled --bg); + + @include iro.bem-elem('native') { + color: fn.color(--disabled --text); + + &::placeholder { + color: fn.color(--disabled --placeholder); + } + } + + @include iro.bem-elem('bg') { + border-color: fn.color(--disabled --border); + } + + @include iro.bem-is('invalid') { + @include iro.bem-elem('native') { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--disabled --border); + } + } + } + + @include iro.bem-elem('native') { + &:invalid { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--disabled --border); + } + } + } + } + } +} diff --git a/tpl/objects/button.pug b/tpl/objects/button.pug index e99e5ab..61ba0b6 100644 --- a/tpl/objects/button.pug +++ b/tpl/objects/button.pug @@ -9,11 +9,14 @@ mixin a-button if (attributes.variant) { classes['o-button--' + attributes.variant] = true } + if (attributes.size) { + classes['o-button--' + attributes.size] = true + } let href = attributes.disabled ? null : '#'; a(class=classes href=href aria-disabled=attributes.disabled && String(attributes.disabled)) if attributes.icon - +icon(attributes.icon)(block=!block) + +icon(attributes.icon) = ' ' block diff --git a/tpl/objects/field-label.pug b/tpl/objects/field-label.pug index 151e084..fb96443 100644 --- a/tpl/objects/field-label.pug +++ b/tpl/objects/field-label.pug @@ -1,17 +1,18 @@ mixin field-label(label, hint=null) - let classes = { - 'o-field-label': true, - 'o-field-label--left': attributes.align === 'left', - 'o-field-label--right': attributes.align === 'right', - 'is-invalid': attributes.invalid, - 'is-disabled': attributes.disabled, + 'o-field-label': true, + 'is-invalid': attributes.invalid, + 'is-disabled': attributes.disabled, + } + if (attributes.align) { + classes['o-field-label--align-' + attributes.align] = true; } if (attributes.class) { classes[attributes.class] = true; } - let needsLabelWidth = attributes.align === 'left' || attributes.align === 'right'; + let needsLabelWidth = !!attributes.align; let labelStyle = needsLabelWidth ? 'width: ' + attributes.labelWidth : ''; diff --git a/tpl/objects/text-field.pug b/tpl/objects/text-field.pug index 895770d..f8e5263 100644 --- a/tpl/objects/text-field.pug +++ b/tpl/objects/text-field.pug @@ -24,7 +24,11 @@ mixin text-field const attr = { placeholder: attributes.placeholder, - disabled: attributes.disabled + disabled: attributes.disabled, + readonly: attributes.readonly, + pattern: attributes.pattern, + required: attributes.required, + value: attributes.value, } div(class=classes aria-disabled=attributes.disabled && String(attributes.disabled)) diff --git a/tpl/views/badge.pug b/tpl/views/badge.pug index 1e1b88f..a55baca 100644 --- a/tpl/views/badge.pug +++ b/tpl/views/badge.pug @@ -1,75 +1,75 @@ mixin view-badge +view('badge', 'Badge') .c-box - +badge(size=50 href='#')= '50' + +badge(size='sm' href='#')= '50' = ' ' +badge= '100' = ' ' - +badge(size=200 href='#')= '200' + +badge(size='lg' href='#')= '200' = ' ' - +badge(size=300 href='#')= '300' + +badge(size='xl' href='#')= '300' .c-box - +badge(size=50 href='#' quiet=true)= '50' + +badge(size='sm' href='#' quiet=true)= '50' = ' ' +badge(quiet=true)= '100' = ' ' - +badge(size=200 href='#' quiet=true)= '200' + +badge(size='lg' href='#' quiet=true)= '200' = ' ' - +badge(size=300 href='#' quiet=true)= '300' + +badge(size='xl' href='#' quiet=true)= '300' each theme in ['accent', 'positive', 'negative', 'warning'] .c-box - +badge(theme)(size=50 href='#')= 'new' + +badge(theme)(size='sm' href='#')= 'new' = ' ' +badge(theme)= 'new' = ' ' - +badge(theme)(size=200 href='#')= 'new' + +badge(theme)(size='lg' href='#')= 'new' = ' ' - +badge(theme)(size=300 href='#')= 'new' + +badge(theme)(size='xl' href='#')= 'new' .c-box - +badge(theme)(size=50 href='#' quiet=true)= 'new' + +badge(theme)(size='sm' href='#' quiet=true)= 'new' = ' ' +badge(theme)(quiet=true)= 'new' = ' ' - +badge(theme)(size=200 href='#' quiet=true)= 'new' + +badge(theme)(size='lg' href='#' quiet=true)= 'new' = ' ' - +badge(theme)(size=300 href='#' quiet=true)= 'new' + +badge(theme)(size='xl' href='#' quiet=true)= 'new' .c-box - +badge(size=50, pill=true)= '50' + +badge(size='sm', pill=true)= '50' = ' ' +badge(pill=true)= '100' = ' ' - +badge(size=200 pill=true)= '200' + +badge(size='lg' pill=true)= '200' = ' ' - +badge(size=300 pill=true)= '300' + +badge(size='xl' pill=true)= '300' .c-box - +badge(size=50 pill=true quiet=true)= 'new' + +badge(size='sm' pill=true quiet=true)= 'new' = ' ' +badge(pill=true quiet=true)= 'new' = ' ' - +badge(size=200 pill=true quiet=true)= 'new' + +badge(size='lg' pill=true quiet=true)= 'new' = ' ' - +badge(size=300 pill=true quiet=true)= 'new' + +badge(size='xl' pill=true quiet=true)= 'new' each theme in ['accent', 'positive', 'negative', 'warning'] .c-box - +badge(theme)(size=50 pill=true href='#')= 'new' + +badge(theme)(size='sm' pill=true href='#')= 'new' = ' ' +badge(theme)(pill=true)= 'new' = ' ' - +badge(theme)(size=200 pill=true href='#')= 'new' + +badge(theme)(size='lg' pill=true href='#')= 'new' = ' ' - +badge(theme)(size=300 pill=true href='#')= 'new' + +badge(theme)(size='xl' pill=true href='#')= 'new' .c-box - +badge(theme)(size=50 pill=true href='#' quiet=true)= 'new' + +badge(theme)(size='sm' pill=true href='#' quiet=true)= 'new' = ' ' +badge(theme)(pill=true quiet=true)= 'new' = ' ' - +badge(theme)(size=200 pill=true href='#' quiet=true)= 'new' + +badge(theme)(size='lg' pill=true href='#' quiet=true)= 'new' = ' ' - +badge(theme)(size=300 pill=true href='#' quiet=true)= 'new' + +badge(theme)(size='xl' pill=true href='#' quiet=true)= 'new' diff --git a/tpl/views/button.pug b/tpl/views/button.pug index 7c96419..4b2281e 100644 --- a/tpl/views/button.pug +++ b/tpl/views/button.pug @@ -1,5 +1,38 @@ mixin view-button +view('button', 'Button') + .c-box + +a-button(size='sm')= 'Button' + = ' ' + +a-button= 'Button' + = ' ' + +a-button(size='lg')= 'Button' + = ' ' + +a-button(size='xl')= 'Button' + br + +a-button(size='sm' disabled=true)= 'Button' + = ' ' + +a-button(disabled=true)= 'Button' + = ' ' + +a-button(size='lg' disabled=true)= 'Button' + = ' ' + +a-button(size='xl' disabled=true)= 'Button' + br + +a-button(size='sm' outline=true)= 'Button' + = ' ' + +a-button(outline=true)= 'Button' + = ' ' + +a-button(size='lg' outline=true)= 'Button' + = ' ' + +a-button(size='xl' outline=true)= 'Button' + br + +a-button(size='sm' outline=true disabled=true)= 'Button' + = ' ' + +a-button(outline=true disabled=true)= 'Button' + = ' ' + +a-button(size='lg' outline=true disabled=true)= 'Button' + = ' ' + +a-button(size='xl' outline=true disabled=true)= 'Button' + .c-box .l-button-group +a-button= 'Button' diff --git a/tpl/views/field-label.pug b/tpl/views/field-label.pug index 37ffb1a..448370a 100644 --- a/tpl/views/field-label.pug +++ b/tpl/views/field-label.pug @@ -20,39 +20,39 @@ mixin view-field-label +text-field(placeholder='Placeholder' type='password' invalid=true disabled=true) .c-box - +field-label('First name')(align='left' labelWidth='100px') + +field-label('First name')(align='start' labelWidth='100px') +text-field(placeholder='Placeholder') br - +field-label('Password', 'At least 6 characters required')(align='left' labelWidth='100px') + +field-label('Password', 'At least 6 characters required')(align='start' labelWidth='100px') +text-field(placeholder='Placeholder' type='password') br - +field-label('Password', 'At least 6 characters required')(align='left' labelWidth='100px' invalid=true) + +field-label('Password', 'At least 6 characters required')(align='start' labelWidth='100px' invalid=true) +text-field(placeholder='Placeholder' type='password' invalid=true) br - +field-label('First name')(align='left' labelWidth='100px' disabled=true) + +field-label('First name')(align='start' labelWidth='100px' disabled=true) +text-field(placeholder='Placeholder' disabled=true) br - +field-label('Password', 'At least 6 characters required')(align='left' labelWidth='100px' disabled=true) + +field-label('Password', 'At least 6 characters required')(align='start' labelWidth='100px' disabled=true) +text-field(placeholder='Placeholder' type='password' disabled=true) br - +field-label('Password', 'At least 6 characters required')(align='left' labelWidth='100px' invalid=true disabled=true) + +field-label('Password', 'At least 6 characters required')(align='start' labelWidth='100px' invalid=true disabled=true) +text-field(placeholder='Placeholder' type='password' invalid=true disabled=true) .c-box - +field-label('First name')(align='right' labelWidth='100px') + +field-label('First name')(align='end' labelWidth='100px') +text-field(placeholder='Placeholder') br - +field-label('Password', 'At least 6 characters required')(align='right' labelWidth='100px') + +field-label('Password', 'At least 6 characters required')(align='end' labelWidth='100px') +text-field(placeholder='Placeholder' type='password') br - +field-label('Password', 'At least 6 characters required')(align='right' labelWidth='100px' invalid=true) + +field-label('Password', 'At least 6 characters required')(align='end' labelWidth='100px' invalid=true) +text-field(placeholder='Placeholder' type='password' invalid=true) br - +field-label('First name')(align='right' labelWidth='100px' disabled=true) + +field-label('First name')(align='end' labelWidth='100px' disabled=true) +text-field(placeholder='Placeholder' disabled=true) br - +field-label('Password', 'At least 6 characters required')(align='right' labelWidth='100px' disabled=true) + +field-label('Password', 'At least 6 characters required')(align='end' labelWidth='100px' disabled=true) +text-field(placeholder='Placeholder' type='password' disabled=true) br - +field-label('Password', 'At least 6 characters required')(align='right' labelWidth='100px' invalid=true disabled=true) + +field-label('Password', 'At least 6 characters required')(align='end' labelWidth='100px' invalid=true disabled=true) +text-field(placeholder='Placeholder' type='password' invalid=true disabled=true) -- cgit v1.2.3-54-g00ecf