diff --git a/playwright/snapshots/si-side-panel.spec.ts-snapshots/si-side-panel--si-side-panel--scroll-mode-element-examples-chromium-light-linux.png b/playwright/snapshots/si-side-panel.spec.ts-snapshots/si-side-panel--si-side-panel--scroll-mode-element-examples-chromium-light-linux.png index 54cbb4558..748e5e602 100644 --- a/playwright/snapshots/si-side-panel.spec.ts-snapshots/si-side-panel--si-side-panel--scroll-mode-element-examples-chromium-light-linux.png +++ b/playwright/snapshots/si-side-panel.spec.ts-snapshots/si-side-panel--si-side-panel--scroll-mode-element-examples-chromium-light-linux.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f0fe3fe6b776d092f8d3f695c56020b33216181caaed77dcab0e99982a78e62d -size 89206 +oid sha256:8be17067ccd0795d99b001e03b7cc1ba71772fe0077dca4b031f83a996bfc5b3 +size 89203 diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-dark-linux.png b/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-dark-linux.png index 1f9182331..70c2260ba 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-dark-linux.png +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-dark-linux.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fd146edcc34cddc996fbb657e80e4b64e40636b0829bbb465fc6b34994ef2b91 -size 43908 +oid sha256:8a23ebc6ae565fa9ae317e571f23a30060f33372dac88dad28ea23018a200938 +size 62745 diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-light-linux.png b/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-light-linux.png index d922761d6..afa274482 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-light-linux.png +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-light-linux.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e72a5fef1209e662de1807833cc48270befe5d1fea76521ccd5c811c2752a2a3 -size 44407 +oid sha256:ddbc9f405eb70a739d554ee8a0ad6c3e1749ba922c098b1f363fda50890fefc3 +size 66515 diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons.yaml b/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons.yaml index d96972cd9..9f5ddc911 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons.yaml +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons.yaml @@ -4,44 +4,65 @@ - button "Secondary" - button "Warning" - button "Danger" -- button "Input" - button "Tertiary" - button "Warning" - button "Danger" +- heading "Buttons with icons" [level=4] - button "Default" - button "Warning" - button "Danger" - button "Secondary" -- button /\d+\.\d+\.\d+ - \d+\.\d+\.\d+/ - button "Tertiary" +- heading "Input buttons" [level=4] +- button "Input" +- button /\d+\.\d+\.\d+ - \d+\.\d+\.\d+/ +- heading "Icon buttons" [level=4] - button "clock" - button "bath" - button "library" -- button "badge" -- button "badge" -- button "badge" -- button "badge" -- button "badge" -- button "badge" +- button "secondary badge" +- button "secondary warning badge" +- button "secondary danger badge" +- button "tertiary badge" +- button "tertiary warning badge" +- button "tertiary danger badge" - button "delete" +- button "close" +- button "close" +- heading "Circle buttons" [level=4] - button "clock" - button "bath" - button "library" -- button "badge" -- button "badge" +- button "secondary badge" +- button "secondary warning badge" +- button "secondary danger badge" +- button "tertiary badge" +- button "tertiary warning badge" +- button "tertiary danger badge" - button "delete" -- button "btn-sm" -- button "default" -- button "btn-lg" -- link "Go back": +- button "close" +- button "close" +- heading "Button sizing" [level=4] +- button "Large" +- button "Default" +- button "Small" +- heading "Icon button sizing" [level=4] +- button "default icon button" +- button "default circle button" +- button "small icon button" +- button "small circle button" +- button "extra small icon button" +- button "extra small circle button" +- heading "Button links" [level=4] +- link "Primary Link": - /url: "#" -- link "Go back": +- link "Warning Link": - /url: "#" -- link "Go back": +- link "Danger Link": - /url: "#" -- link "Go back": +- link "Secondary Link": - /url: "#" -- link "Go back": +- link "Tertiary Link": - /url: "#" -- checkbox "Disable all buttons" +- switch "Disable all buttons" - text: Disable all buttons \ No newline at end of file diff --git a/projects/element-theme/src/styles/bootstrap/_button-group.scss b/projects/element-theme/src/styles/bootstrap/_button-group.scss index cc28b95ff..9e76a07d7 100644 --- a/projects/element-theme/src/styles/bootstrap/_button-group.scss +++ b/projects/element-theme/src/styles/bootstrap/_button-group.scss @@ -52,6 +52,11 @@ margin-inline-start: -1px; } + .btn-icon { + inline-size: unset; + padding-inline: calc(#{map.get(spacers.$spacers, 2)} - var(--btn-border-width, 0px)); + } + // Dropdown toggle styling for split buttons .btn.dropdown-toggle { inline-size: 24px; diff --git a/projects/element-theme/src/styles/bootstrap/_buttons.scss b/projects/element-theme/src/styles/bootstrap/_buttons.scss index 17b6bb318..8d6821171 100644 --- a/projects/element-theme/src/styles/bootstrap/_buttons.scss +++ b/projects/element-theme/src/styles/bootstrap/_buttons.scss @@ -64,14 +64,6 @@ button { margin-block: -#{map.get(spacers.$spacers, 2)}; margin-inline: -#{map.get(spacers.$spacers, 2)} #{map.get(spacers.$spacers, 2)}; } - - &.btn-icon { - padding-inline: calc(#{map.get(spacers.$spacers, 2)} - var(--btn-border-width, 0px)); - - .icon { - margin-inline: 0; - } - } } .btn:not(:is(.btn-circle, .btn-link, .btn-close, .btn-icon)) { @@ -156,15 +148,28 @@ button { } } -// Circle Buttons +// Icon buttons with circle variant // -------------- -:is(.btn-circle, .btn-close) { - padding: 0 !important; // stylelint-disable-line declaration-no-important - border-radius: 50%; +.btn:is(.btn-circle, .btn-icon, .btn-close) { + display: inline-flex; + padding: 0; flex-shrink: 0; + + .icon { + margin-inline: 0; + } +} + +.btn-icon { + border-radius: semantic-tokens.$element-button-radius; } .btn-circle { + border-radius: 50%; +} + +.btn-circle, +.btn-icon { &, &.btn-lg { @include button-circle-size($btn-circle-size-default, $btn-circle-font-size-default); @@ -185,6 +190,7 @@ button { } .btn-circle.btn-ghost, +.btn-icon.btn-ghost, .btn-close { --btn-bg: transparent; --btn-bg-hover: #{semantic-tokens.$element-action-secondary-hover}; @@ -192,6 +198,11 @@ button { --btn-color-hover: #{semantic-tokens.$element-ui-1}; } +.btn-close.btn-tertiary { + --btn-color: #{semantic-tokens.$element-action-secondary-text}; + --btn-color-hover: #{semantic-tokens.$element-action-secondary-text-hover}; +} + .btn-lg { font-size: bootstrap-variables.$btn-font-size-lg; line-height: 1.5; @@ -211,7 +222,6 @@ button { &::before { content: '\002715'; font-size: 1rem; - margin-block-start: 2px; } > * { diff --git a/src/app/examples/buttons/button-groups.html b/src/app/examples/buttons/button-groups.html index e8ec48a10..07561b116 100644 --- a/src/app/examples/buttons/button-groups.html +++ b/src/app/examples/buttons/button-groups.html @@ -42,37 +42,37 @@
- - -
- - -
- - -
diff --git a/src/app/examples/buttons/buttons.html b/src/app/examples/buttons/buttons.html index eae6c6393..a0b21fdb8 100644 --- a/src/app/examples/buttons/buttons.html +++ b/src/app/examples/buttons/buttons.html @@ -1,177 +1,296 @@ -
-
- - - - - - - - - - -
+
+
+
+ + + + + + + + + +
-
- - - - - - -
+

Buttons with icons

+
+ + + + + +
-
- - - - - - - - - - - - - - - - - - - -
+

Input buttons

+
+ + +
-
- - - - - - - - - - - -
+

Icon buttons

+
+ -
- - - -
+ + + + + + + + + + + + + + + + + + + + + +
+ +

Circle buttons

+
+ -
- Go back - Go back - Go back - Go back - Go back + + + + + + + + + + + + + + + + + + + + + +
+ +

Button sizing

+
+ + + +
+ +

Icon button sizing

+
+ + + + + + +
+ +

Button links

+
-
-
- - +
+
+ + +
+
diff --git a/src/app/examples/buttons/selection-buttons.html b/src/app/examples/buttons/selection-buttons.html index 1d242cac5..d564c150d 100644 --- a/src/app/examples/buttons/selection-buttons.html +++ b/src/app/examples/buttons/selection-buttons.html @@ -34,17 +34,17 @@

Single-select

-
diff --git a/src/app/examples/buttons/split-button.html b/src/app/examples/buttons/split-button.html index 6271507db..35ac27865 100644 --- a/src/app/examples/buttons/split-button.html +++ b/src/app/examples/buttons/split-button.html @@ -7,7 +7,7 @@