Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
754ef21
refactor: added sizes and restyling
mfranzke Sep 30, 2022
24c247e
docs(checkbox): added sizes documentation
mfranzke Sep 30, 2022
b4cc4b6
feat(checkbox): added required states styles
mfranzke Oct 3, 2022
57a74ec
chore: further styling adaptions
mfranzke Oct 3, 2022
4cc9fbe
chore: adapted to (and reduced) test URL list
mfranzke Oct 3, 2022
dfcd6b8
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Oct 21, 2022
b156778
chore: stylelint fix
mfranzke Oct 21, 2022
091c4b4
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Nov 4, 2022
4ba05fa
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Nov 4, 2022
1e8013d
refactor: simplified sizing by using aspect-ratio
mfranzke Nov 4, 2022
5801e95
chore: added a comment
mfranzke Nov 4, 2022
c11970f
refactor: rework on the sizes available
mfranzke Nov 4, 2022
fa6d3e5
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Nov 10, 2022
52c9942
refactor: removed the obsolete large checkbox size
mfranzke Nov 10, 2022
744a2ec
refactor: checkbox styling
mfranzke Nov 10, 2022
8f794bb
fix: checkbox spacings
mfranzke Nov 10, 2022
324ce29
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Nov 11, 2022
de3d256
refactor: we even need to differentiate the font-size on sized icons …
mfranzke Nov 11, 2022
3580918
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Nov 15, 2022
d071aa0
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Nov 16, 2022
6235216
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Dec 16, 2022
c0cc9b8
test: fix html validate feedback
mfranzke Dec 16, 2022
9f20547
chore: stylelint order feedback
mfranzke Dec 16, 2022
9c0c6da
refactor: needed to update DB UI Base with an enhanced mixin
mfranzke Dec 16, 2022
2ea861d
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Jan 13, 2023
4cdee18
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Jan 13, 2023
c9d322c
refactor: aligned tonality display
mfranzke Jan 13, 2023
32dcf4d
refactor: tonality display
mfranzke Jan 13, 2023
91727a9
Merge branch 'main' into refactor-guidelines-3-checkbox-style
mfranzke Jan 27, 2023
1b4c88a
chore: regenerated lock file
mfranzke Jan 27, 2023
40fff63
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Jan 27, 2023
06d281e
refactor: corrected the sizes
mfranzke Jan 27, 2023
0625e96
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Jan 27, 2023
bb6347d
Merge branch 'dbux-3' into refactor-guidelines-3-checkbox-style
mfranzke Jan 27, 2023
51b655c
Update checkbox.scss
mfranzke Jan 27, 2023
9a4f8e4
docs: added entry to migrationguide
mfranzke Jan 27, 2023
dda5fb9
refactor: added necessary references
mfranzke Jan 31, 2023
7e98f8d
refactor: corrected typography declarations
mfranzke Feb 10, 2023
938fa7e
refactor: using variables for the margin here
mfranzke Feb 10, 2023
8346d65
style: further optimizations
mfranzke Feb 10, 2023
21acb82
refactor: removed checkboxes on dark background
mfranzke Feb 10, 2023
33370ff
refactor: we don't need those variables files anymore
mfranzke Feb 10, 2023
472d7c5
refactor: switched to new colors placeholders
mfranzke Feb 10, 2023
99f93cc
refactor: need to make some fine adjustments regarding the icon and c…
mfranzke Feb 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/migrationGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ We've remove the deprecated previous HTML implementation of the label by an `out

=== `input`

- The input background style variations `semitransparent`, `solid`, `white` and `outline` have been removed. Input fields have only one background style left.
- The input background style variations `semitransparent`, `solid`, `white` and `outline` have been removed. Input fields have only one background style left.
- Introducing 3 different sizes of input fields according to our `tonality` introduction: `functional`, `regular`, `expressive
- Integration of `data-icon-before` and `data-icon-after` property for enabling use of custom icons in input fields
- Introducing new variations: `error`, `warning`, `success` and `information` following the new guidelines 3.0 color system
Expand All @@ -50,6 +50,11 @@ We've remove the deprecated previous HTML implementation of the label by an `out
- Changed use of `data-variant` to use with `primary` and used `data-content` attribute for differentiation between `internal` and `external`
- Font-size definition has moved to DB UI Base due to our `tonality` introduction (default and for `data-size=small`)

=== `checkbox`

- Introducing 3 different sizes of checkbox elements according to our `tonality` introduction: `functional`, `regular`, `expressive
- Additionally to set the size via `tonality`, we've even also introduced a `size` setting for the radios, with which you could decrease the size by one level

== DB UI Core 2.2.0 Migration Guide

=== progress element
Expand Down
3,435 changes: 2,494 additions & 941 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions source/_patterns/01-elements/checkbox/_checkbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Checkbox
state: inevaluation
---

## Variations/configurability

### Size

#### SCSS (recommended)

Extend the size SCSS placeholders in case that you don't want the default (medium): `%size-Small`

#### HTML attribute

You could set the different button sizes via the `data-size` attribute, the default is "medium" and in that case is optional.

[inspirational sources for this page]: # "https://www.uiguideline.com/components/checkbox"
16 changes: 0 additions & 16 deletions source/_patterns/01-elements/checkbox/_checkbox.variables.scss

This file was deleted.

7 changes: 7 additions & 0 deletions source/_patterns/01-elements/checkbox/checkbox-sizes.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{#each sizes }}
<!-- [html-validate-disable-next heading-level, no-unused-disable -- the h1 is already provided by the general pattern] -->
<h2>{{ label }}</h2>
<p>
{{> elements-checkbox id=../id }}
</p>
{{/each }}
14 changes: 14 additions & 0 deletions source/_patterns/01-elements/checkbox/checkbox-sizes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"sizes": [
{
"size": "small",
"label": "Small"
},
{
"size": "medium",
"label": "Medium (default, data-size attribute is optional)"
}
],
"id": "checkbox05",
"label": "Checkbox"
}
6 changes: 6 additions & 0 deletions source/_patterns/01-elements/checkbox/checkbox-tonality.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<dl>
{{#each tonality as |tonality| }}
<dt>{{ tonality }}:</dt>
<dd data-tonality="{{ tonality }}">{{> elements-checkbox id=(unique-id) label="Checkbox" }}</dd>
{{/each }}
</dl>
10 changes: 6 additions & 4 deletions source/_patterns/01-elements/checkbox/checkbox.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<input type="checkbox"
class="elm-checkbox {{ styleModifier }}"
id="{{ id }}"{{#if checked}} checked{{/if }}
id="{{ id }}{{#if size }}-{{ size }}{{/if }}"{{#if checked}} checked{{/if }}
{{#if disabled}} disabled{{/if }}
value="{{ value }}"
{{#if describedbyid }} aria-describedby="{{ describedbyid }}"{{/if }}>
<label class="elm-label" for="{{ id }}">{{ label }}</label>
{{#if describedbyid }} aria-describedby="{{ describedbyid }}"{{/if }}
{{#if size }} data-size="{{ size }}"{{/if }}
{{#if required }} required{{/if }}
><label class="elm-label" for="{{ id }}{{#if size }}-{{ size }}{{/if }}">{{ label }}</label>
{{#if indeterminate}}
<script>
document.querySelector('#{{ id }}').indeterminate = true;
document.querySelector('#{{ id }}{{#if size }}-{{ size }}{{/if }}').indeterminate = true;
</script>
{{/if }}
6 changes: 0 additions & 6 deletions source/_patterns/01-elements/checkbox/checkbox.md

This file was deleted.

92 changes: 62 additions & 30 deletions source/_patterns/01-elements/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
@@ -1,60 +1,64 @@
@charset "utf-8";

@use "@db-ui/base/build/scss/variables" as *;
@use "@db-ui/base/build/scss/variables.global" as *;
@use "@db-ui/base/build/scss/helpers/functions" as *;
@use "@db-ui/base/build/scss/icon/icons.helpers" as *;

@import "../../../css/partials.meta";
@import "checkbox.variables";

.elm-checkbox {
@include icon("\00A0", 24, "outline", $partial: $partial);
// We need to reset the general icons margin, as we want to use it in a tiny space
--icon-margin-after: 0;
// Using another CSS variable for the size to differentiate for the small variant later
--checkbox-size: #{$db-sizing-sm};

$checkbox-size: 24;

@extend %db-bg-neutral-0;
@extend %db-bg-neutral-0-ia-states;

@include icon("\00A0", $checkbox-size, "outline", $partial: $partial);
@include icon-meta($font-size: $checkbox-size - 2);

align-content: center;

appearance: none;
background-color: $checkbox---backgroundColor;
border: #{to-rem($pxValue: 1)} solid $checkbox---borderColor;
border-radius: 4px;
color: $checkbox---color;

aspect-ratio: 1;

border: calc(var(--checkbox-size, #{$db-sizing-sm}) / 16 + 0.5px) solid
currentColor;
border-radius: 3px;

display: inline-flex;
height: to-rem($pxValue: 24);
height: var(--checkbox-size);
justify-content: center;
width: to-rem($pxValue: 24);

&[type="checkbox"] {
vertical-align: top;
vertical-align: bottom;
}

// Icons font size
&::before {
--icon-font-size: 1.375rem;
margin-right: 0;
--icon-font-size: calc(var(--checkbox-size) - 2px);
}

&:checked {
background-color: $checkbox--checked-backgroundColor;
@extend %db-bg-secondary;
@extend %db-bg-secondary-ia-states;

// The icon within the checkbox has the same dimensions as the checkbox itself and that for there can't be any border
border-width: 0;
padding: 1px;

&::before {
color: $checkbox--checked-color;
color: inherit;
content: glyph(done);
}
}

&:not(:disabled) {
&:hover {
background-color: rgba(40, 45, 55, 0.14);
}

&:checked {
&:hover {
background-color: $checkbox-hover-checked-backgroundColor;
}
}

&:active {
background-color: rgba(40, 45, 55, 0.14);
}
}
// TODO: We need to set the correct styling / color for invalid

&:indeterminate {
&::before {
Expand All @@ -65,11 +69,39 @@
&:disabled {
&,
& + label {
opacity: 0.5;
opacity: 0.25;
}
}

& + label {
margin-left: $db-spacing-fixed-regular-xs;
font-size: $db-typography-regular-desktop-body-medium-font-size;
line-height: $db-typography-regular-desktop-body-medium-line-height;

margin-inline-start: $db-spacing-fixed-regular-xs;
}

// Sizes
&%size-Small {
--checkbox-size: calc(#{$db-sizing-sm} * 0.83333333);

// TODO: we still need to scale this
& + label {
font-size: $db-typography-regular-desktop-body-small-font-size;
line-height: $db-typography-regular-desktop-body-small-line-height;

margin-inline-start: $db-spacing-fixed-regular-2xs;
}
}

&[data-size="small"] {
@extend %size-Small;
}

&:required {
& + label {
&::after {
content: " *";
}
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"id": "checkbox06",
"required": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@

@use "@db-ui/base/build/scss/variables" as *;
@use "@db-ui/base/build/scss/helpers/functions" as *;
@import "checkbox.variables";
@import "../checkbox.variables";

.pl-js-pattern-example {
[id^="elements-checkbox-on-dark-background"] & {
background-color: $db-colors-secondary-enabled;
color: $db-colors-secondary-on-enabled;
padding: to-rem($pxValue: 16);

.elm-checkbox {
background-color: $checkbox-onDarkBackground--backgroundColor;
border-color: $checkbox-onDarkBackground--borderColor;
color: $checkbox-onDarkBackground--color;
}
}
}
// .pl-js-pattern-example {
// }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
@import "checkbox.variables";
@import "../checkbox";