diff --git a/docs/_data/buttons.json b/docs/_data/buttons.json index bb6ac39329..1f98ba8cf7 100755 --- a/docs/_data/buttons.json +++ b/docs/_data/buttons.json @@ -35,6 +35,26 @@ } ] } + ] + , + "featured": [ + { + "title": "Featured", + "class": "s-btn__featured", + "classes": [ + { + "title": "Clear" + }, + { + "title": "Outlined", + "class": "s-btn__outlined" + }, + { + "title": "Filled", + "class": "s-btn__filled" + } + ] + } ], "muted": [ { diff --git a/docs/product/components/buttons.html b/docs/product/components/buttons.html index a4e9ec23e9..e85f8c8860 100644 --- a/docs/product/components/buttons.html +++ b/docs/product/components/buttons.html @@ -11,6 +11,7 @@
  1. Base
  2. Danger
  3. +
  4. Featured
  5. Muted

Each style is explained below, detailing how and where to use these styles.

@@ -119,6 +120,61 @@ + + {% header "h3", "Featured" %} + +

Featured buttons are…

+ +
+{% highlight html %} + + + +{% endhighlight %} +
+
+ + + + + + + + + + + + {% for btn in buttons.featured %} + {% assign types = btn.classes %} + {% for class in types %} + + + + + + + + {% endfor %} + {% endfor %} + +
TypeClassDefault StateSelected StateDisabled State
+ {{ class.title }} + +
+ .s-btn + {% if btn.class != nil %} + .{{ btn.class }} + {% endif %} + {% if class.class != nil %} + .{{ class.class }} + {% endif %} +
+
+
+
+
+ + {% header "h3", "Muted" %}

Muted buttons are a secondary button style, a grayscale visual treatment. Used in layouts for the least important items or currently inactive actions.

diff --git a/lib/components/button/button.less b/lib/components/button/button.less index 3f937609d6..4166f6a021 100644 --- a/lib/components/button/button.less +++ b/lib/components/button/button.less @@ -268,6 +268,32 @@ --_bu-number-fc-filled: var(--black); } + &&__featured { + --_bu-bg-active: var(--purple-300); + --_bu-bg-hover: var(--purple-200); + --_bu-bg-selected: var(--purple-300); + --_bu-fc: var(--purple-500); + --_bu-fc-active: var(--_bu-fc); + --_bu-fc-hover: var(--purple-500); + --_bu-fc-selected: var(--purple-600); + --_bu-filled-bc: transparent; + --_bu-filled-bc-selected: var(--_bu-filled-bc); + --_bu-filled-bg: var(--purple-400); + --_bu-filled-bg-active: var(--purple-500); + --_bu-filled-bg-hover: var(--purple-500); + --_bu-filled-bg-selected: var(--purple-600); + --_bu-filled-fc: var(--white); + --_bu-filled-fc-active: var(--_bu-filled-fc); + --_bu-filled-fc-hover: var(--_bu-filled-fc); + --_bu-filled-fc-selected: var(--_bu-filled-fc); + --_bu-outlined-bc: var(--purple-400); + --_bu-outlined-bc-selected: var(--purple-500); + --_bu-outlined-bg-selected: var(--_bu-bg-selected); + --_bu-outlined-fc-selected: var(--_bu-fc-selected); + --_bu-number-fc: var(--white); + --_bu-number-fc-filled: var(--black); + } + &&__muted { --_bu-bc-hover: var(--black-300); --_bu-bg-active: var(--black-150); diff --git a/lib/components/button/button.test.setup.ts b/lib/components/button/button.test.setup.ts index dd1efc2b04..3d7445e2de 100644 --- a/lib/components/button/button.test.setup.ts +++ b/lib/components/button/button.test.setup.ts @@ -16,7 +16,7 @@ const getChild = (child?: string): string => { // TODO test disabled states, interaction pseudo-classes const testArgs: TestVariationArgs = { baseClass: "s-btn", - variants: ["danger", "muted"], + variants: ["danger", "featured", "muted"], modifiers: { primary: ["filled", "outlined"], secondary: [...["xs", "sm", "md"], ...["dropdown", "icon"]],