From 3e4e674cecc81e22a716e14168239c886cd2da31 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke
- {{> elements-button variant='primary' value='Primary' icon='add' }}
- {{> elements-button variant='primary' value='Primary (disabled)' disabled='true' icon='add' }}
-
- {{> elements-button variant='primary' value='Primary with icon' icon-after='add'}}
- {{> elements-button variant='primary' value='Primary with icon (disabled)' disabled='true' icon-after='add' }}
-
- {{> elements-button variant='primary' value='Primary without icon' }}
- {{> elements-button variant='primary' value='Primary without icon (disabled)' disabled='true' }}
-
- {{> elements-button variant='primary' title='Check' value='Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }}
- {{> elements-button variant='primary' title='Check' value='Primary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }}
-
+ {{> elements-button variant='secondary-inverted' value='Secondary inverted' icon='add' }}
+ {{> elements-button variant='secondary-inverted' value='Secondary inverted (disabled)' disabled='true' icon='add' }}
+
+ {{> elements-button variant='secondary-inverted' value='Secondary inverted with icon' icon-after='add'}}
+ {{> elements-button variant='secondary-inverted' value='Secondary inverted with icon (disabled)' disabled='true' icon-after='add' }}
+
+ {{> elements-button variant='secondary-inverted' value='Secondary inverted without icon' }}
+ {{> elements-button variant='secondary-inverted' value='Secondary inverted without icon (disabled)' disabled='true' }}
+
+ {{> elements-button variant='secondary-inverted' title='Check' value='Secondary inverted displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }}
+ {{> elements-button variant='secondary-inverted' title='Check' value='Secondary inverted displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }}
+
+ {{> elements-button variant='ghost' value='Ghost' }}
+ {{> elements-button variant='ghost' value='Ghost' disabled='true' }}
+
+ {{> elements-button variant='ghost' value='Ghost with right icon' icon-after='add'}}
+ {{> elements-button variant='ghost' value='Ghost with right icon(disabled)' disabled='true' icon-after='add' }}
+
+ {{> elements-button variant='ghost' title='Check' value='Ghost displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }} + {{> elements-button variant='ghost' title='Check' value='Ghost displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }} +
diff --git a/source/_patterns/01-elements/buttons/06-button-tertiary-plain.hbs b/source/_patterns/01-elements/buttons/06-button-tertiary-plain.hbs deleted file mode 100644 index 229181abc90..00000000000 --- a/source/_patterns/01-elements/buttons/06-button-tertiary-plain.hbs +++ /dev/null @@ -1,16 +0,0 @@ - -- {{> elements-button variant='tertiary-plain' value='Tertiary Plain' }} - {{> elements-button variant='tertiary-plain' value='Tertiary Plain' disabled='true' }} -
-- {{> elements-button variant='tertiary-plain' value='Tertiary Plain with right icon' icon-after='add'}} - {{> elements-button variant='tertiary-plain' value='Tertiary Plain with right icon(disabled)' disabled='true' icon-after='add' }} -
- {{> elements-button variant='tertiary-plain' value='Tertiary Plain without left icon' }} - {{> elements-button variant='tertiary-plain' value='Tertiary Plain without left icon (disabled)' disabled='true' }} - -- {{> elements-button variant='tertiary-plain' title='Check' value='Tertiary Plain displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }} - {{> elements-button variant='tertiary-plain' title='Check' value='Tertiary Plain displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }} -
diff --git a/source/_patterns/01-elements/buttons/button.scss b/source/_patterns/01-elements/buttons/button.scss index a8bdc26b02b..1b1b960d652 100644 --- a/source/_patterns/01-elements/buttons/button.scss +++ b/source/_patterns/01-elements/buttons/button.scss @@ -108,7 +108,7 @@ } } - &%variant-tertiaryPlain { + &%variant-ghost { color: $db-color-cool-gray-700; border: 2px solid transparent; background-color: transparent; // shame.css @@ -175,8 +175,8 @@ &[data-variant="secondary-solid"] { @extend %variant-secondarySolid; } - &[data-variant="tertiary-plain"] { - @extend %variant-tertiaryPlain; + &[data-variant="ghost"] { + @extend %variant-ghost; } &:disabled { diff --git a/tests/backstop.json b/tests/backstop.json index c64d8de8227..a789b672069 100644 --- a/tests/backstop.json +++ b/tests/backstop.json @@ -515,14 +515,14 @@ "onReadyScript": "puppet/clickAndHoverHelper.js" }, { - "label": "Button Tertiary", - "url": "http://127.0.0.1:8080/patterns/elements-buttons-06-button-tertiary-plain/elements-buttons-06-button-tertiary-plain.rendered.html", - "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-06-button-tertiary-plain/elements-buttons-06-button-tertiary-plain.rendered.html" + "label": "Button Ghost", + "url": "http://127.0.0.1:8080/patterns/elements-buttons-06-button-ghost/elements-buttons-06-button-ghost.rendered.html", + "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-06-button-ghost/elements-buttons-06-button-ghost.rendered.html" }, { - "label": "Button Tertiary - hovered", - "url": "http://127.0.0.1:8080/patterns/elements-buttons-06-button-tertiary-plain/elements-buttons-06-button-tertiary-plain.rendered.html", - "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-06-button-tertiary-plain/elements-buttons-06-button-tertiary-plain.rendered.html", + "label": "Button Ghost - hovered", + "url": "http://127.0.0.1:8080/patterns/elements-buttons-06-button-ghost/elements-buttons-06-button-ghost.rendered.html", + "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-06-button-ghost/elements-buttons-06-button-ghost.rendered.html", "hoverSelectors": [ "p:nth-of-type(1) .elm-button:nth-of-type(1)", "p:nth-of-type(1) .elm-button:nth-of-type(2)", From 7728cf4767343ac5f28caf11862b32ce85a9d40a Mon Sep 17 00:00:00 2001 From: Maximilian Franzke- {{> elements-button variant='secondary-solid' value='Secondary' icon='add' }} - {{> elements-button variant='secondary-solid' value='Secondary (disabled)' disabled='true' icon='add' }} -
-- {{> elements-button variant='secondary-solid' value='Secondary Solid with right icon' icon-after='add'}} - {{> elements-button variant='secondary-solid' value='Secondary Solid with right icon (disabled)' disabled='true' icon-after='add' }} -
-- {{> elements-button variant='secondary-solid' value='Secondary Solid without icon' }} - {{> elements-button variant='secondary-solid' value='Secondary Solid without icon (disabled)' disabled='true' }} -
-- {{> elements-button variant='secondary-solid' title='Check' value='Secondary Solid displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }} - {{> elements-button variant='secondary-solid' title='Check' value='Secondary Solid displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }} -
diff --git a/source/_patterns/01-elements/buttons/05-button-tertiary.hbs b/source/_patterns/01-elements/buttons/05-button-tertiary.hbs new file mode 100644 index 00000000000..28fb7308c22 --- /dev/null +++ b/source/_patterns/01-elements/buttons/05-button-tertiary.hbs @@ -0,0 +1,16 @@ ++ {{> elements-button variant='tertiary' value='Tertiary' icon='add' }} + {{> elements-button variant='tertiary' value='Tertiary (disabled)' disabled='true' icon='add' }} +
++ {{> elements-button variant='tertiary' value='Tertiary with right icon' icon-after='add'}} + {{> elements-button variant='tertiary' value='Tertiary with right icon (disabled)' disabled='true' icon-after='add' }} +
++ {{> elements-button variant='tertiary' value='Tertiary without icon' }} + {{> elements-button variant='tertiary' value='Tertiary without icon (disabled)' disabled='true' }} +
++ {{> elements-button variant='tertiary' title='Check' value='Tertiary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }} + {{> elements-button variant='tertiary' title='Check' value='Tertiary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }} +
diff --git a/source/_patterns/01-elements/buttons/_button.variables.scss b/source/_patterns/01-elements/buttons/_button.variables.scss index dbad8df8379..9cf0a849c20 100644 --- a/source/_patterns/01-elements/buttons/_button.variables.scss +++ b/source/_patterns/01-elements/buttons/_button.variables.scss @@ -15,9 +15,9 @@ $button-brand-primary-hover-backgroundColor: #db0016; $button-secondaryInverted--backgroundColor: $db-color-cool-gray-700 !default; $button-secondaryInverted-hover-backgroundColor: #2f3541; -$button-secondarySolid--backgroundColor: $db-color-cool-gray-200 !default; -$button-secondarySolid-hover-backgroundColor: #cdd4da !default; -$button-secondarySolid-active-backgroundColor: #c5ccd3 !default; +$button-tertiary--backgroundColor: $db-color-cool-gray-200 !default; +$button-tertiary-hover-backgroundColor: #cdd4da !default; +$button-tertiary-active-backgroundColor: #c5ccd3 !default; $button-secondaryOutline-hover-backgroundColor: rgba( $db-color-cool-gray-700, diff --git a/source/_patterns/01-elements/buttons/button.scss b/source/_patterns/01-elements/buttons/button.scss index 1b1b960d652..b6e00aa7363 100644 --- a/source/_patterns/01-elements/buttons/button.scss +++ b/source/_patterns/01-elements/buttons/button.scss @@ -94,17 +94,17 @@ } } - &%variant-secondarySolid { + &%variant-tertiary { color: $db-color-cool-gray-700; - background-color: $button-secondarySolid--backgroundColor; + background-color: $button-tertiary--backgroundColor; &:not(:disabled) { &:hover { // TODO: This could probably get simplified later on e.g. via CSS variables - background-color: $button-secondarySolid-hover-backgroundColor; + background-color: $button-tertiary-hover-backgroundColor; } } &:active { - background-color: $button-secondarySolid-active-backgroundColor; + background-color: $button-tertiary-active-backgroundColor; } } @@ -172,8 +172,8 @@ &[data-variant="secondary-outline"] { @extend %variant-secondaryOutline; } - &[data-variant="secondary-solid"] { - @extend %variant-secondarySolid; + &[data-variant="tertiary"] { + @extend %variant-tertiary; } &[data-variant="ghost"] { @extend %variant-ghost; diff --git a/tests/backstop.json b/tests/backstop.json index a789b672069..be2f1496f31 100644 --- a/tests/backstop.json +++ b/tests/backstop.json @@ -499,14 +499,14 @@ "onReadyScript": "puppet/clickAndHoverHelper.js" }, { - "label": "Button Secondary Solid", - "url": "http://127.0.0.1:8080/patterns/elements-buttons-05-button-secondary-solid/elements-buttons-05-button-secondary-solid.rendered.html", - "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-05-button-secondary-solid/elements-buttons-05-button-secondary-solid.rendered.html" + "label": "Button Tertiary", + "url": "http://127.0.0.1:8080/patterns/elements-buttons-05-button-tertiary/elements-buttons-05-button-tertiary.rendered.html", + "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-05-button-tertiary/elements-buttons-05-button-tertiary.rendered.html" }, { - "label": "Button Secondary Solid - hovered", - "url": "http://127.0.0.1:8080/patterns/elements-buttons-05-button-secondary-solid/elements-buttons-05-button-secondary-solid.rendered.html", - "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-05-button-secondary-solid/elements-buttons-05-button-secondary-solid.rendered.html", + "label": "Button Tertiary - hovered", + "url": "http://127.0.0.1:8080/patterns/elements-buttons-05-button-tertiary/elements-buttons-05-button-tertiary.rendered.html", + "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-05-button-tertiary/elements-buttons-05-button-tertiary.rendered.html", "hoverSelectors": [ "p:nth-of-type(1) .elm-button:nth-of-type(1)", "p:nth-of-type(1) .elm-button:nth-of-type(2)" From f7b01441241bb4209690016b4d5ba158667fe5f1 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke- {{> elements-button variant='secondary-outline' value='Secondary Outline' icon='add' }} - {{> elements-button variant='secondary-outline' value='Secondary Outline (disabled)' disabled='true' icon='add' }} -
-- {{> elements-button variant='secondary-outline' value='Secondary Outline with right icon' icon-after='add'}} - {{> elements-button variant='secondary-outline' value='Secondary Outline with right icon (disabled)' disabled='true' icon-after='add' }} -
-- {{> elements-button variant='secondary-outline' value='Secondary Outline without left icon' }} - {{> elements-button variant='secondary-outline' value='Secondary Outline without left icon (disabled)' disabled='true' }} -
-- {{> elements-button variant='secondary-outline' title='Check' value='Secondary Outline displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }} - {{> elements-button variant='secondary-outline' title='Check' value='Secondary Outline displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }} -
diff --git a/source/_patterns/01-elements/buttons/04-button-secondary.hbs b/source/_patterns/01-elements/buttons/04-button-secondary.hbs new file mode 100644 index 00000000000..605cb5d1dc2 --- /dev/null +++ b/source/_patterns/01-elements/buttons/04-button-secondary.hbs @@ -0,0 +1,16 @@ ++ {{> elements-button variant='secondary' value='Secondary' icon='add' }} + {{> elements-button variant='secondary' value='Secondary (disabled)' disabled='true' icon='add' }} +
++ {{> elements-button variant='secondary' value='Secondary with right icon' icon-after='add'}} + {{> elements-button variant='secondary' value='Secondary with right icon (disabled)' disabled='true' icon-after='add' }} +
++ {{> elements-button variant='secondary' value='Secondary without left icon' }} + {{> elements-button variant='secondary' value='Secondary without left icon (disabled)' disabled='true' }} +
++ {{> elements-button variant='secondary' title='Check' value='Secondary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }} + {{> elements-button variant='secondary' title='Check' value='Secondary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }} +
diff --git a/source/_patterns/01-elements/buttons/_button.variables.scss b/source/_patterns/01-elements/buttons/_button.variables.scss index 9cf0a849c20..29b35f82ef0 100644 --- a/source/_patterns/01-elements/buttons/_button.variables.scss +++ b/source/_patterns/01-elements/buttons/_button.variables.scss @@ -19,12 +19,12 @@ $button-tertiary--backgroundColor: $db-color-cool-gray-200 !default; $button-tertiary-hover-backgroundColor: #cdd4da !default; $button-tertiary-active-backgroundColor: #c5ccd3 !default; -$button-secondaryOutline-hover-backgroundColor: rgba( +$button-secondary-hover-backgroundColor: rgba( $db-color-cool-gray-700, 0.03 ) !default; -$button-secondaryOutline-active-backgroundColor: rgba( +$button-secondary-active-backgroundColor: rgba( $db-color-cool-gray-700, 0.06 ) !default; diff --git a/source/_patterns/01-elements/buttons/button.scss b/source/_patterns/01-elements/buttons/button.scss index b6e00aa7363..7aaa151b2f4 100644 --- a/source/_patterns/01-elements/buttons/button.scss +++ b/source/_patterns/01-elements/buttons/button.scss @@ -71,7 +71,7 @@ } } - &%variant-secondaryOutline { + &%variant-secondary { background-color: transparent; border-color: $db-color-cool-gray-700; color: $db-color-cool-gray-700; @@ -82,7 +82,7 @@ &:not(:disabled) { &:hover { // TODO: This could probably get simplified later on e.g. via CSS variables - background-color: $button-secondaryOutline-hover-backgroundColor; + background-color: $button-secondary-hover-backgroundColor; } } &:disabled { @@ -90,7 +90,7 @@ color: $db-color-cool-gray-700; } &:active { - background-color: $button-secondaryOutline-active-backgroundColor; + background-color: $button-secondary-active-backgroundColor; } } @@ -115,14 +115,14 @@ &:not(:disabled) { &:hover { // TODO: This could probably get simplified later on e.g. via CSS variables - background-color: $button-secondaryOutline-hover-backgroundColor; + background-color: $button-secondary-hover-backgroundColor; } } &:disabled { background-color: transparent; // shame.css } &:active { - background-color: $button-secondaryOutline-active-backgroundColor; + background-color: $button-secondary-active-backgroundColor; } } @@ -169,8 +169,8 @@ &[data-variant="secondary-inverted"] { @extend %variant-secondary-inverted; } - &[data-variant="secondary-outline"] { - @extend %variant-secondaryOutline; + &[data-variant="secondary"] { + @extend %variant-secondary; } &[data-variant="tertiary"] { @extend %variant-tertiary; diff --git a/tests/backstop.json b/tests/backstop.json index be2f1496f31..d336635230d 100644 --- a/tests/backstop.json +++ b/tests/backstop.json @@ -479,14 +479,14 @@ "onReadyScript": "puppet/clickAndHoverHelper.js" }, { - "label": "Button Secondary Outline", - "url": "http://127.0.0.1:8080/patterns/elements-buttons-04-button-secondary-outline/elements-buttons-04-button-secondary-outline.rendered.html", - "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-04-button-secondary-outline/elements-buttons-04-button-secondary-outline.rendered.html" + "label": "Button Secondary", + "url": "http://127.0.0.1:8080/patterns/elements-buttons-04-button-secondary/elements-buttons-04-button-secondary.rendered.html", + "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-04-button-secondary/elements-buttons-04-button-secondary.rendered.html" }, { - "label": "Button Secondary Outline - hovered", - "url": "http://127.0.0.1:8080/patterns/elements-buttons-04-button-secondary-outline/elements-buttons-04-button-secondary-outline.rendered.html", - "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-04-button-secondary-outline/elements-buttons-04-button-secondary-outline.rendered.html", + "label": "Button Secondary - hovered", + "url": "http://127.0.0.1:8080/patterns/elements-buttons-04-button-secondary/elements-buttons-04-button-secondary.rendered.html", + "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-04-button-secondary/elements-buttons-04-button-secondary.rendered.html", "hoverSelectors": [ "p:nth-of-type(1) .elm-button:nth-of-type(1)", "p:nth-of-type(1) .elm-button:nth-of-type(2)", From 0c4f69d4cd5e5d68fc35040a313701d39c6cb124 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke- {{> elements-button variant='brand-primary' value='Brand Primary' icon='add'}} - {{> elements-button variant='brand-primary' value='Brand Primary' disabled='true' icon='add' }} -
-- {{> elements-button variant='brand-primary' value='Brand Primary with right icon' icon-after='add'}} - {{> elements-button variant='brand-primary' value='Brand Primary with right icon(disabled)' disabled='true' icon-after='add' }} -
-- {{> elements-button variant='brand-primary' value='Brand Primary without icon' }} - {{> elements-button variant='brand-primary' value='Brand Primary without icon (disabled)' disabled='true' }} -
-- {{> elements-button variant='brand-primary' title='Check' value='Brand Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }} - {{> elements-button variant='brand-primary' title='Check' value='Brand Primary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }} -
diff --git a/source/_patterns/01-elements/buttons/01-button-primary.hbs b/source/_patterns/01-elements/buttons/01-button-primary.hbs new file mode 100644 index 00000000000..bb8fc099a4a --- /dev/null +++ b/source/_patterns/01-elements/buttons/01-button-primary.hbs @@ -0,0 +1,17 @@ +{{!-- TODO: let's not use those modifier classes, but inherit their meaning via CSS correctly and introduce sample classes for the styleguide --}} ++ {{> elements-button variant='primary' value='Primary' icon='add'}} + {{> elements-button variant='primary' value='Primary' disabled='true' icon='add' }} +
++ {{> elements-button variant='primary' value='Primary with right icon' icon-after='add'}} + {{> elements-button variant='primary' value='Primary with right icon(disabled)' disabled='true' icon-after='add' }} +
++ {{> elements-button variant='primary' value='Primary without icon' }} + {{> elements-button variant='primary' value='Primary without icon (disabled)' disabled='true' }} +
++ {{> elements-button variant='primary' title='Check' value='Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }} + {{> elements-button variant='primary' title='Check' value='Primary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }} +
diff --git a/source/_patterns/01-elements/buttons/09-button-sizes.hbs b/source/_patterns/01-elements/buttons/09-button-sizes.hbs index c5f91e9b7e0..ffb51376b6c 100644 --- a/source/_patterns/01-elements/buttons/09-button-sizes.hbs +++ b/source/_patterns/01-elements/buttons/09-button-sizes.hbs @@ -1,19 +1,19 @@ {{#each sizes }}- {{> elements-button variant='brand-primary' value='Brand Primary' icon='add' size=size }} - {{> elements-button variant='brand-primary' value='Brand Primary (disabled)' disabled='true' icon='add' size=size }} + {{> elements-button variant='primary' value='Primary' icon='add' size=size }} + {{> elements-button variant='primary' value='Primary (disabled)' disabled='true' icon='add' size=size }}
- {{> elements-button variant='brand-primary' value='Brand Primary with right icon' icon-after='add' size=size }} - {{> elements-button variant='brand-primary' value='Brand Primary with right icon(disabled)' disabled='true' icon-after='add' size=size }} + {{> elements-button variant='primary' value='Primary with right icon' icon-after='add' size=size }} + {{> elements-button variant='primary' value='Primary with right icon(disabled)' disabled='true' icon-after='add' size=size }}
- {{> elements-button variant='brand-primary' value='Brand Primary without icon' size=size }} - {{> elements-button variant='brand-primary' value='Brand Primary without icon (disabled)' disabled='true' size=size }} + {{> elements-button variant='primary' value='Primary without icon' size=size }} + {{> elements-button variant='primary' value='Primary without icon (disabled)' disabled='true' size=size }}
- {{> elements-button variant='brand-primary' title='Done' value='Brand Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' size=size }} - {{> elements-button variant='brand-primary' title='Done' value='Brand Primary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' size=size }} + {{> elements-button variant='primary' title='Done' value='Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' size=size }} + {{> elements-button variant='primary' title='Done' value='Primary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' size=size }}
{{/each }} diff --git a/source/_patterns/01-elements/buttons/_button.variables.scss b/source/_patterns/01-elements/buttons/_button.variables.scss index 29b35f82ef0..c032fd71fe1 100644 --- a/source/_patterns/01-elements/buttons/_button.variables.scss +++ b/source/_patterns/01-elements/buttons/_button.variables.scss @@ -9,8 +9,8 @@ $button---minHeight: to-rem( ) !default; // Background colors -$button-brand-primary--backgroundColor: $db-color-red-500 !default; -$button-brand-primary-hover-backgroundColor: #db0016; +$button-primary--backgroundColor: $db-color-red-500 !default; +$button-primary-hover-backgroundColor: #db0016; $button-secondaryInverted--backgroundColor: $db-color-cool-gray-700 !default; $button-secondaryInverted-hover-backgroundColor: #2f3541; diff --git a/source/_patterns/01-elements/buttons/button.scss b/source/_patterns/01-elements/buttons/button.scss index 7aaa151b2f4..ba07ed633e5 100644 --- a/source/_patterns/01-elements/buttons/button.scss +++ b/source/_patterns/01-elements/buttons/button.scss @@ -33,23 +33,23 @@ filter: brightness(75%); }*/ - &%variant-brand-primary, + &%variant-primary, &%variant-secondary-inverted { color: $button---color; } - &%variant-brand-primary, + &%variant-primary, &%variant-secondary-inverted { font-weight: 700; } - &%variant-brand-primary { - background-color: $button-brand-primary--backgroundColor; + &%variant-primary { + background-color: $button-primary--backgroundColor; &:not(:disabled) { &:hover { // TODO: This could probably get simplified later on e.g. via CSS variables - background-color: $button-brand-primary-hover-backgroundColor; + background-color: $button-primary-hover-backgroundColor; } } &:active { @@ -163,8 +163,8 @@ } // Providing the variants as HTML attributes as well - &[data-variant="brand-primary"] { - @extend %variant-brand-primary; + &[data-variant="primary"] { + @extend %variant-primary; } &[data-variant="secondary-inverted"] { @extend %variant-secondary-inverted; diff --git a/source/_patterns/02-components/dialog/dialog.hbs b/source/_patterns/02-components/dialog/dialog.hbs index 27e6591d81a..88cf2d02110 100644 --- a/source/_patterns/02-components/dialog/dialog.hbs +++ b/source/_patterns/02-components/dialog/dialog.hbs @@ -11,6 +11,6 @@ diff --git a/tests/backstop.json b/tests/backstop.json index d336635230d..ca18f4e2409 100644 --- a/tests/backstop.json +++ b/tests/backstop.json @@ -439,14 +439,14 @@ "onReadyScript": "puppet/clickAndHoverHelper.js" }, { - "label": "Button Brand Primary", - "url": "http://127.0.0.1:8080/patterns/elements-buttons-01-button-brand-primary/elements-buttons-01-button-brand-primary.rendered.html", - "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-01-button-brand-primary/elements-buttons-01-button-brand-primary.rendered.html" + "label": "Button Primary", + "url": "http://127.0.0.1:8080/patterns/elements-buttons-01-button-primary/elements-buttons-01-button-primary.rendered.html", + "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-01-button-primary/elements-buttons-01-button-primary.rendered.html" }, { - "label": "Button Brand Primary - hovered", - "url": "http://127.0.0.1:8080/patterns/elements-buttons-01-button-brand-primary/elements-buttons-01-button-brand-primary.rendered.html", - "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-01-button-brand-primary/elements-buttons-01-button-brand-primary.rendered.html", + "label": "Button Primary - hovered", + "url": "http://127.0.0.1:8080/patterns/elements-buttons-01-button-primary/elements-buttons-01-button-primary.rendered.html", + "referenceUrl": "https://db-ui.github.io/core/patterns/elements-buttons-01-button-primary/elements-buttons-01-button-primary.rendered.html", "hoverSelectors": [ "p:nth-of-type(1) .elm-button:nth-of-type(1)", "p:nth-of-type(1) .elm-button:nth-of-type(2)", From d89637eb9dda070cc929ce12698970521715bb36 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke- {{> elements-button variant='primary' value='Primary with right icon' icon-after='add'}} - {{> elements-button variant='primary' value='Primary with right icon(disabled)' disabled='true' icon-after='add' }} -
{{> elements-button variant='primary' value='Primary without icon' }} {{> elements-button variant='primary' value='Primary without icon (disabled)' disabled='true' }} diff --git a/source/_patterns/01-elements/buttons/02-button-secondary.hbs b/source/_patterns/01-elements/buttons/02-button-secondary.hbs index 605cb5d1dc2..354fdeba0bd 100644 --- a/source/_patterns/01-elements/buttons/02-button-secondary.hbs +++ b/source/_patterns/01-elements/buttons/02-button-secondary.hbs @@ -2,10 +2,6 @@ {{> elements-button variant='secondary' value='Secondary' icon='add' }} {{> elements-button variant='secondary' value='Secondary (disabled)' disabled='true' icon='add' }}
-- {{> elements-button variant='secondary' value='Secondary with right icon' icon-after='add'}} - {{> elements-button variant='secondary' value='Secondary with right icon (disabled)' disabled='true' icon-after='add' }} -
{{> elements-button variant='secondary' value='Secondary without left icon' }} {{> elements-button variant='secondary' value='Secondary without left icon (disabled)' disabled='true' }} diff --git a/source/_patterns/01-elements/buttons/03-button-secondary-inverted.hbs b/source/_patterns/01-elements/buttons/03-button-secondary-inverted.hbs index 4ffc9687c9e..cbcab4c2e63 100644 --- a/source/_patterns/01-elements/buttons/03-button-secondary-inverted.hbs +++ b/source/_patterns/01-elements/buttons/03-button-secondary-inverted.hbs @@ -2,10 +2,6 @@ {{> elements-button variant='secondary-inverted' value='Secondary inverted' icon='add' }} {{> elements-button variant='secondary-inverted' value='Secondary inverted (disabled)' disabled='true' icon='add' }}
-- {{> elements-button variant='secondary-inverted' value='Secondary inverted with icon' icon-after='add'}} - {{> elements-button variant='secondary-inverted' value='Secondary inverted with icon (disabled)' disabled='true' icon-after='add' }} -
{{> elements-button variant='secondary-inverted' value='Secondary inverted without icon' }} {{> elements-button variant='secondary-inverted' value='Secondary inverted without icon (disabled)' disabled='true' }} diff --git a/source/_patterns/01-elements/buttons/05-button-tertiary.hbs b/source/_patterns/01-elements/buttons/05-button-tertiary.hbs index 28fb7308c22..1b3e734daef 100644 --- a/source/_patterns/01-elements/buttons/05-button-tertiary.hbs +++ b/source/_patterns/01-elements/buttons/05-button-tertiary.hbs @@ -2,10 +2,6 @@ {{> elements-button variant='tertiary' value='Tertiary' icon='add' }} {{> elements-button variant='tertiary' value='Tertiary (disabled)' disabled='true' icon='add' }}
-- {{> elements-button variant='tertiary' value='Tertiary with right icon' icon-after='add'}} - {{> elements-button variant='tertiary' value='Tertiary with right icon (disabled)' disabled='true' icon-after='add' }} -
{{> elements-button variant='tertiary' value='Tertiary without icon' }} {{> elements-button variant='tertiary' value='Tertiary without icon (disabled)' disabled='true' }} diff --git a/source/_patterns/01-elements/buttons/06-button-ghost.hbs b/source/_patterns/01-elements/buttons/06-button-ghost.hbs index 65e4e74c358..5349c966eda 100644 --- a/source/_patterns/01-elements/buttons/06-button-ghost.hbs +++ b/source/_patterns/01-elements/buttons/06-button-ghost.hbs @@ -4,9 +4,6 @@ {{> elements-button variant='ghost' value='Ghost' disabled='true' }}
- {{> elements-button variant='ghost' value='Ghost with right icon' icon-after='add'}} - {{> elements-button variant='ghost' value='Ghost with right icon(disabled)' disabled='true' icon-after='add' }} -
{{> elements-button variant='ghost' value='Ghost without left icon' }} {{> elements-button variant='ghost' value='Ghost without left icon (disabled)' disabled='true' }} diff --git a/source/_patterns/01-elements/buttons/09-button-sizes.hbs b/source/_patterns/01-elements/buttons/09-button-sizes.hbs index ffb51376b6c..141926ee1d9 100644 --- a/source/_patterns/01-elements/buttons/09-button-sizes.hbs +++ b/source/_patterns/01-elements/buttons/09-button-sizes.hbs @@ -4,10 +4,6 @@ {{> elements-button variant='primary' value='Primary' icon='add' size=size }} {{> elements-button variant='primary' value='Primary (disabled)' disabled='true' icon='add' size=size }} -- {{> elements-button variant='primary' value='Primary with right icon' icon-after='add' size=size }} - {{> elements-button variant='primary' value='Primary with right icon(disabled)' disabled='true' icon-after='add' size=size }} -
{{> elements-button variant='primary' value='Primary without icon' size=size }}
{{> elements-button variant='primary' value='Primary without icon (disabled)' disabled='true' size=size }}
From 85429b13d949c84ff559fa585a5dd17fdf427a9a Mon Sep 17 00:00:00 2001
From: Maximilian Franzke
- {{> elements-button variant='primary' value='Primary' icon='add'}}
- {{> elements-button variant='primary' value='Primary' disabled='true' icon='add' }}
+ {{> elements-button variant='primary' value='Primary' }}
+ {{> elements-button variant='primary' value='Primary (disabled)' disabled='true' }}
- {{> elements-button variant='primary' value='Primary without icon' }}
- {{> elements-button variant='primary' value='Primary without icon (disabled)' disabled='true' }}
+ {{> elements-button variant='primary' value='Primary' icon='add'}}
+ {{> elements-button variant='primary' value='Primary' disabled='true' icon='add' }}
{{> elements-button variant='primary' title='Check' value='Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }}
diff --git a/source/_patterns/01-elements/buttons/02-button-secondary.hbs b/source/_patterns/01-elements/buttons/02-button-secondary.hbs
index 354fdeba0bd..b90f3997fa8 100644
--- a/source/_patterns/01-elements/buttons/02-button-secondary.hbs
+++ b/source/_patterns/01-elements/buttons/02-button-secondary.hbs
@@ -1,10 +1,10 @@
- {{> elements-button variant='secondary' value='Secondary' icon='add' }}
- {{> elements-button variant='secondary' value='Secondary (disabled)' disabled='true' icon='add' }}
+ {{> elements-button variant='secondary' value='Secondary' }}
+ {{> elements-button variant='secondary' value='Secondary (disabled)' disabled='true' }}
- {{> elements-button variant='secondary' value='Secondary without left icon' }}
- {{> elements-button variant='secondary' value='Secondary without left icon (disabled)' disabled='true' }}
+ {{> elements-button variant='secondary' value='Secondary' icon='add' }}
+ {{> elements-button variant='secondary' value='Secondary (disabled)' disabled='true' icon='add' }}
{{> elements-button variant='secondary' title='Check' value='Secondary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }}
diff --git a/source/_patterns/01-elements/buttons/03-button-secondary-inverted.hbs b/source/_patterns/01-elements/buttons/03-button-secondary-inverted.hbs
index cbcab4c2e63..a88ad87e7a3 100644
--- a/source/_patterns/01-elements/buttons/03-button-secondary-inverted.hbs
+++ b/source/_patterns/01-elements/buttons/03-button-secondary-inverted.hbs
@@ -1,10 +1,10 @@
- {{> elements-button variant='secondary-inverted' value='Secondary inverted' icon='add' }}
- {{> elements-button variant='secondary-inverted' value='Secondary inverted (disabled)' disabled='true' icon='add' }}
+ {{> elements-button variant='secondary-inverted' value='Secondary inverted' }}
+ {{> elements-button variant='secondary-inverted' value='Secondary inverted (disabled)' disabled='true' }}
- {{> elements-button variant='secondary-inverted' value='Secondary inverted without icon' }}
- {{> elements-button variant='secondary-inverted' value='Secondary inverted without icon (disabled)' disabled='true' }}
+ {{> elements-button variant='secondary-inverted' value='Secondary inverted' icon='add' }}
+ {{> elements-button variant='secondary-inverted' value='Secondary inverted (disabled)' disabled='true' icon='add' }}
{{> elements-button variant='secondary-inverted' title='Check' value='Secondary inverted displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }}
diff --git a/source/_patterns/01-elements/buttons/05-button-tertiary.hbs b/source/_patterns/01-elements/buttons/05-button-tertiary.hbs
index 1b3e734daef..f92756cc628 100644
--- a/source/_patterns/01-elements/buttons/05-button-tertiary.hbs
+++ b/source/_patterns/01-elements/buttons/05-button-tertiary.hbs
@@ -1,10 +1,10 @@
- {{> elements-button variant='tertiary' value='Tertiary' icon='add' }}
- {{> elements-button variant='tertiary' value='Tertiary (disabled)' disabled='true' icon='add' }}
+ {{> elements-button variant='tertiary' value='Tertiary' }}
+ {{> elements-button variant='tertiary' value='Tertiary (disabled)' disabled='true' }}
- {{> elements-button variant='tertiary' value='Tertiary without icon' }}
- {{> elements-button variant='tertiary' value='Tertiary without icon (disabled)' disabled='true' }}
+ {{> elements-button variant='tertiary' value='Tertiary' icon='add' }}
+ {{> elements-button variant='tertiary' value='Tertiary (disabled)' disabled='true' icon='add' }}
{{> elements-button variant='tertiary' title='Check' value='Tertiary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }}
diff --git a/source/_patterns/01-elements/buttons/06-button-ghost.hbs b/source/_patterns/01-elements/buttons/06-button-ghost.hbs
index 5349c966eda..a47df3fbf3e 100644
--- a/source/_patterns/01-elements/buttons/06-button-ghost.hbs
+++ b/source/_patterns/01-elements/buttons/06-button-ghost.hbs
@@ -1,11 +1,10 @@
-
{{> elements-button variant='ghost' value='Ghost' }}
- {{> elements-button variant='ghost' value='Ghost' disabled='true' }}
+ {{> elements-button variant='ghost' value='Ghost (disabled)' disabled='true' }}
- {{> elements-button variant='ghost' value='Ghost without left icon' }}
- {{> elements-button variant='ghost' value='Ghost without left icon (disabled)' disabled='true' }}
+ {{> elements-button variant='ghost' value='Ghost' }}
+ {{> elements-button variant='ghost' value='Ghost' disabled='true' }}
{{> elements-button variant='ghost' title='Check' value='Ghost displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }}
diff --git a/source/_patterns/01-elements/buttons/09-button-sizes.hbs b/source/_patterns/01-elements/buttons/09-button-sizes.hbs
index 141926ee1d9..3c415d09c67 100644
--- a/source/_patterns/01-elements/buttons/09-button-sizes.hbs
+++ b/source/_patterns/01-elements/buttons/09-button-sizes.hbs
@@ -5,8 +5,8 @@
{{> elements-button variant='primary' value='Primary (disabled)' disabled='true' icon='add' size=size }}
- {{> elements-button variant='primary' value='Primary without icon' size=size }}
- {{> elements-button variant='primary' value='Primary without icon (disabled)' disabled='true' size=size }}
+ {{> elements-button variant='primary' value='Primary' size=size }}
+ {{> elements-button variant='primary' value='Primary (disabled)' disabled='true' size=size }}
{{> elements-button variant='primary' title='Done' value='Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' size=size }}
From 5ac4b1ad89059ed3ecff5b868f07c832443fb40c Mon Sep 17 00:00:00 2001
From: Maximilian Franzke
- {{> elements-button variant='primary' value='Primary' icon='add' size=size }}
- {{> elements-button variant='primary' value='Primary (disabled)' disabled='true' icon='add' size=size }}
-
{{> elements-button variant='primary' value='Primary' size=size }}
{{> elements-button variant='primary' value='Primary (disabled)' disabled='true' size=size }}
+ {{> elements-button variant='primary' value='Primary' icon='add' size=size }}
+ {{> elements-button variant='primary' value='Primary (disabled)' disabled='true' icon='add' size=size }}
+
{{> elements-button variant='primary' title='Done' value='Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' size=size }}
{{> elements-button variant='primary' title='Done' value='Primary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' size=size }}
From 9202b2158663f02721d5bc537c63da26dffa506e Mon Sep 17 00:00:00 2001
From: Maximilian Franzke
+ {{> elements-button variant='primary' title='Check' value='loading' state='loading' }}
+
+ {{> elements-button variant='secondary' title='Check' value='loading' state='loading' }}
+{{ label }}
-
+ {{> elements-button variant='secondary-inverted' title='Check' value='loading' state='loading' }} +
diff --git a/source/_patterns/01-elements/buttons/05-button-tertiary.hbs b/source/_patterns/01-elements/buttons/05-button-tertiary.hbs index f92756cc628..3dbeeb4e721 100644 --- a/source/_patterns/01-elements/buttons/05-button-tertiary.hbs +++ b/source/_patterns/01-elements/buttons/05-button-tertiary.hbs @@ -10,3 +10,6 @@ {{> elements-button variant='tertiary' title='Check' value='Tertiary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }} {{> elements-button variant='tertiary' title='Check' value='Tertiary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }} ++ {{> elements-button variant='tertiary' title='Check' value='loading' state='loading' }} +
diff --git a/source/_patterns/01-elements/buttons/06-button-ghost.hbs b/source/_patterns/01-elements/buttons/06-button-ghost.hbs index a47df3fbf3e..5d244786dcb 100644 --- a/source/_patterns/01-elements/buttons/06-button-ghost.hbs +++ b/source/_patterns/01-elements/buttons/06-button-ghost.hbs @@ -10,3 +10,6 @@ {{> elements-button variant='ghost' title='Check' value='Ghost displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }} {{> elements-button variant='ghost' title='Check' value='Ghost displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }} ++ {{> elements-button variant='ghost' title='Check' value='loading' state='loading' }} +
diff --git a/source/_patterns/01-elements/buttons/button.hbs b/source/_patterns/01-elements/buttons/button.hbs index 8c56e018fde..79dce364f31 100644 --- a/source/_patterns/01-elements/buttons/button.hbs +++ b/source/_patterns/01-elements/buttons/button.hbs @@ -7,6 +7,8 @@ {{#if role }} role="{{ role }}"{{/if }} {{#if disabled }} disabled{{/if }} {{#if icon}} data-icon="{{ icon }}"{{/if}} - {{#if icon-after}} data-icon-after="{{ icon-after }}"{{/if}}> + {{#if icon-after}} data-icon-after="{{ icon-after }}"{{/if}} + {{#if state}} data-state="{{ state }}"{{/if}}> {{{ value }}} + {{#if_eq state "loading" }}{{> elements-loading-indicator size="xs" }}{{/if_eq }} diff --git a/source/_patterns/01-elements/buttons/button.scss b/source/_patterns/01-elements/buttons/button.scss index 0ec9ab399eb..6973f786f95 100644 --- a/source/_patterns/01-elements/buttons/button.scss +++ b/source/_patterns/01-elements/buttons/button.scss @@ -284,4 +284,19 @@ &:disabled { opacity: 0.25; } + + // States (currently only "loading") + &[data-state="loading"] { + @include is-icon-text-replace(); + + &::before { + content: " "; + } + } + + // Including a loading indicator + --loadingIndicator---color: currentColor; + &[data-state="loading"] { + font-size: 0; + } } diff --git a/source/_patterns/01-elements/loading-indicator/loading-indicator.scss b/source/_patterns/01-elements/loading-indicator/loading-indicator.scss index e28d3ba696c..ca32d005048 100644 --- a/source/_patterns/01-elements/loading-indicator/loading-indicator.scss +++ b/source/_patterns/01-elements/loading-indicator/loading-indicator.scss @@ -28,7 +28,7 @@ } .elm-loadingindicator { - color: $db-color-red-500; + color: var(--loadingIndicator---color, #{$db-color-red-500}); animation: loadingindicator-rotate 3s linear infinite; @include loadingindicator--sizes("elm-"); From 1c8aaaa60db63cfa26ba47a1c3361f8b38f794f0 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Wed, 12 Oct 2022 16:08:05 +0200 Subject: [PATCH 31/31] Update button.scss --- source/_patterns/01-elements/buttons/button.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_patterns/01-elements/buttons/button.scss b/source/_patterns/01-elements/buttons/button.scss index 6973f786f95..7f3b4242445 100644 --- a/source/_patterns/01-elements/buttons/button.scss +++ b/source/_patterns/01-elements/buttons/button.scss @@ -157,7 +157,7 @@ &%size-XSmall { $height: 24; // $icon-size: 16; - // TODO: remove this dirty hack after we've got the correct 16px icons + // TODO: replace this dirty hack after we've got the correct 16px icons / replace 20 by 16 $icon-size: 20; min-height: to-rem($pxValue: $height); @@ -189,7 +189,7 @@ &%size-Small { $height: 32; // $icon-size: 16; - // TODO: remove this dirty hack after we've got the correct 16px icons + // TODO: replace this dirty hack after we've got the correct 16px icons / replace 20 by 16 $icon-size: 20; min-height: to-rem($pxValue: $height);