@daffodil/design 0.42.2 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/esm2020/atoms/button/button.component.mjs +1 -1
  2. package/esm2020/molecules/callout/callout/callout.component.mjs +2 -2
  3. package/esm2020/molecules/card/card/card.component.mjs +2 -2
  4. package/esm2020/molecules/hero/hero/hero.component.mjs +2 -2
  5. package/esm2020/molecules/image-list/image-list.component.mjs +2 -2
  6. package/esm2020/molecules/list/list/list.component.mjs +2 -2
  7. package/esm2020/molecules/paginator/paginator.component.mjs +2 -2
  8. package/fesm2015/daffodil-design.mjs +12 -12
  9. package/fesm2015/daffodil-design.mjs.map +1 -1
  10. package/fesm2020/daffodil-design.mjs +12 -12
  11. package/fesm2020/daffodil-design.mjs.map +1 -1
  12. package/package.json +1 -1
  13. package/{src/scss → scss}/README.md +0 -0
  14. package/scss/accessibility/_errors.scss +12 -0
  15. package/scss/accessibility/_index.scss +1 -0
  16. package/scss/core/_index.scss +4 -0
  17. package/scss/core/map/map-deep-check/map-deep-check.scss +26 -0
  18. package/scss/core/map/map-deep-check/map-deep-check.spec.scss +43 -0
  19. package/scss/core/map/map-deep-get/map-deep-get.scss +27 -0
  20. package/scss/core/map/map-deep-get/map-deep-get.spec.scss +25 -0
  21. package/scss/core/string/split/string-split.scss +33 -0
  22. package/scss/core/string/split/string-split.spec.scss +35 -0
  23. package/scss/daff-global.scss +49 -0
  24. package/scss/daff-typography.scss +55 -0
  25. package/scss/daff-util.scss +21 -0
  26. package/scss/interactions/_index.scss +1 -0
  27. package/scss/interactions/mouse/_clickable.scss +22 -0
  28. package/scss/layout/_breakpoint.scss +21 -0
  29. package/scss/layout/_index.scss +2 -0
  30. package/scss/layout/_variables.scss +13 -0
  31. package/scss/theme.scss +77 -0
  32. package/scss/theming/README.md +59 -0
  33. package/scss/theming/_color-palettes.scss +116 -0
  34. package/scss/theming/_configure-palette.scss +20 -0
  35. package/scss/theming/_configure-theme.scss +68 -0
  36. package/scss/theming/_get-color.scss +18 -0
  37. package/scss/theming/_index.scss +6 -0
  38. package/scss/theming/_theme-css-variables.scss +43 -0
  39. package/scss/theming/contrast/_index.scss +5 -0
  40. package/scss/theming/contrast/contrast-ratio/contrast-ratio.scss +11 -0
  41. package/scss/theming/contrast/contrast-ratio/contrast-ratio.spec.scss +0 -0
  42. package/scss/theming/contrast/luminance/_variables.scss +268 -0
  43. package/scss/theming/contrast/luminance/luminance.scss +19 -0
  44. package/scss/theming/contrast/luminance/luminance.spec.scss +24 -0
  45. package/scss/theming/contrast/text-contrast/text-contrast.scss +34 -0
  46. package/scss/theming/contrast/text-contrast/text-contrast.spec.scss +0 -0
  47. package/scss/theming/illuminate/illuminate.scss +145 -0
  48. package/scss/theming/illuminate/illuminate.spec.scss +15 -0
  49. package/scss/theming/prebuilt/internal-theme.scss +13 -0
  50. package/scss/typography/README.md +88 -0
  51. package/scss/typography/_classes.scss +20 -0
  52. package/scss/typography/_index.scss +5 -0
  53. package/scss/typography/mixins/_font-weight.scss +18 -0
  54. package/scss/typography/mixins/_sizes.scss +84 -0
  55. package/scss/typography/mixins/_text-transform.scss +4 -0
  56. package/scss/typography/mixins/_text-truncate.scss +23 -0
  57. package/scss/typography/utilities/_index.scss +1 -0
  58. package/scss/typography/utilities/_variables.scss +12 -0
  59. package/src/atoms/button/README.md +16 -11
  60. package/src/atoms/button/button-theme-variants/button.scss +35 -0
  61. package/src/atoms/button/button-theme-variants/focus.scss +6 -0
  62. package/src/atoms/button/button-theme-variants/icon.scss +21 -0
  63. package/src/atoms/button/button-theme-variants/raised.scss +56 -0
  64. package/src/atoms/button/button-theme-variants/stroked.scss +36 -0
  65. package/src/atoms/button/button-theme-variants/underline.scss +9 -0
  66. package/src/atoms/button/button-theme.scss +570 -0
  67. package/src/atoms/form/error-message/error-message-theme.scss +7 -0
  68. package/src/atoms/form/form-field/form-field/form-field-theme.scss +38 -0
  69. package/src/atoms/form/input/input-theme.scss +16 -0
  70. package/src/atoms/form/radio/radio.scss +0 -0
  71. package/src/atoms/form/select/select/select-theme.scss +19 -0
  72. package/src/atoms/loading-icon/loading-icon-theme.scss +57 -0
  73. package/src/atoms/progress-indicator/progress-indicator-theme.scss +60 -0
  74. package/src/molecules/accordion/accordion-item/accordion-item-theme.scss +12 -0
  75. package/src/molecules/article/article/_stops-article-cascade.scss +7 -0
  76. package/src/molecules/article/article/article-theme.scss +78 -0
  77. package/src/molecules/callout/callout-theme.scss +59 -0
  78. package/src/molecules/card/card/card-theme-variants/basic-card.scss +6 -0
  79. package/src/molecules/card/card/card-theme-variants/linkable-card.scss +23 -0
  80. package/src/molecules/card/card/card-theme-variants/stroked-card.scss +3 -0
  81. package/src/molecules/card/card/card-theme.scss +186 -0
  82. package/src/molecules/hero/hero-theme.scss +59 -0
  83. package/src/molecules/list/list/list-theme.scss +68 -0
  84. package/src/molecules/media-gallery/media-gallery-theme.scss +20 -0
  85. package/src/molecules/modal/modal-theme.scss +9 -0
  86. package/src/molecules/navbar/navbar-theme.scss +57 -0
  87. package/src/molecules/paginator/paginator-theme.scss +72 -0
  88. package/src/molecules/sidebar/sidebar/sidebar-theme.scss +13 -0
  89. package/src/molecules/sidebar/sidebar-viewport/sidebar-viewport-theme.scss +11 -0
  90. package/daff-global.scss +0 -2
  91. package/daff-theme.scss +0 -3633
  92. package/daff-typography.scss +0 -505
  93. package/daff-util.scss +0 -377
@@ -0,0 +1,13 @@
1
+ @import '../variables';
2
+ @import '../color';
3
+ @import '../configure-palette';
4
+ @import '../configure-theme';
5
+ @import '../theme';
6
+
7
+ $primary: daff-configure-palette($daff-blue, 60);
8
+ $secondary: daff-configure-palette($daff-purple, 60);
9
+ $tertiary: daff-configure-palette($daff-turquoise, 60);
10
+
11
+ $theme: daff-configure-theme($primary, $secondary, $tertiary);
12
+
13
+ @include daff-theme($theme);
@@ -0,0 +1,88 @@
1
+ # Typography
2
+ Daffodil uses typography to establish hierarchy and create clear visual patterns to guide users through a product or experience.
3
+
4
+ ## Usage
5
+ To include typography in your project, you can add the following in your Sass file:
6
+
7
+ ```scss
8
+ @use '@daffodil/design/scss/typography';
9
+ ```
10
+
11
+ ## Type Scale
12
+ `@daffodil/design`'s typographic scale is designed with visual distinctions to help users better understand content and UI. Text sizes, styles, and layouts have been chosen to maintain logical hierarchies and drive consistency throughout an application.
13
+
14
+ ### 8px System
15
+ Our type scale is based on an 8px system, where the type is largely divisible by 8. For smaller sizes, the system allows for the scale to be divisible by 4. Font sizes are typically smaller on mobile and scaled up at the `tablet` breakpoint to be larger on desktop.
16
+
17
+ ## Font Stack
18
+ Daffodil uses a system font stack to maximize on performance, legibility, and accessibility. System fonts play into the improvement of today's rich displays Additionally, system fonts provides a seamless experience for users because the application feel more like it blends in with their device's OS.
19
+
20
+ ```scss
21
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
22
+ ```
23
+
24
+ * `-apple-system` and `BlinkMacSystemFont` targets default fonts in Safari, Firefox, and Chrome on macOS and iOS.
25
+ * `Segoe UI` is the system font for Windows.
26
+ * `Helvetica` and `Arial` are added as fallbacks.
27
+ * `Apple Color Emoji`, `Segoe UI Emoji`, and `Segoe UI Symbol` are included so that emojis are rendered correctly in macOS and Windows.
28
+
29
+ ## Typography Mixins
30
+ Typography mixins are used to keep typography consistent with logical hierarchies. Utilizing the mixin ensures that content within the UI are clear and easily recognizable. Mixins are available for headlines, body, subheading, and caption. They are used within the `@daffodil/design` components and can also be used within custom CSS.
31
+
32
+ The headline mixins are responsive and will adjust at the `tablet` breakpoint.
33
+
34
+ | Mixin | Font size: mobile | Line height: mobile | Font size: desktop | Line height: desktop | Font weight | Letter spacing |
35
+ | ----------- | ----------------- | ------------------- | ------------------ | -------------------- | ----------- | -------------- |
36
+ | headline-xl | 40px | 48px | 56px | 64px | 700 | 0px |
37
+ | headline-lg | 32px | 36px | 48px | 56px | 700 | 0px |
38
+ | headline-md | 24px | 28px | 32px | 40px | 700 | 0px |
39
+ | headline-sm | 20px | 24px | 24px | 32px | 700 | 0px |
40
+ | body-lg | 24px | 32px | 24px | 32px | 400 | 0px |
41
+ | body-md | 20px | 28px | 20px | 28px | 400 | 0px |
42
+ | body-sm | 16px | 24px | 16px | 24px | 400 | 0px |
43
+ | body-xs | 14px | 20px | 14px | 20px | 400 | 0px |
44
+ | subheading | 14px | 16px | 14px | 16px | 700 | 0.5px |
45
+ | caption | 12px | 16px | 12px | 16px | 400 | 0px |
46
+
47
+ **Example:**
48
+ ```scss
49
+ @use '@daffodil/design/scss/typography';
50
+
51
+ .title {
52
+ @include typography.headline-xl;
53
+ }
54
+ ```
55
+
56
+ ## Formatting Utilities and Mixins
57
+ `@daffodil/design` also provides a few mixins to enforce consistency and ease-of-use. We recommend using the utility classes sparingly.
58
+
59
+ | Class/Mixin | Description |
60
+ | ------------- | ---------------------------------------------------------------------------- |
61
+ | embolden | Changes the weight of text to 700 |
62
+ | uppercase | Changes the casing of a piece of text to uppercase |
63
+ | text-truncate | Forces a line of text to ellipsis once it reaches the width of its container |
64
+
65
+ > `text-truncate` should only be used if the element is `display: block;` or `display: inline-block;`
66
+
67
+ **Examples:**
68
+ ```html
69
+ <div class="title"><span class="embolden">Daffodil</span> is a frontend Ecommerce framework that allows developers to build complex Ecommerce stores.</div>
70
+ ```
71
+
72
+ ```scss
73
+ @use '@daffodil/design/scss/typography';
74
+
75
+ .title {
76
+ span {
77
+ @include typography.embolden;
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Typography Variables
83
+ ```scss
84
+ $large-font-size: 1.5rem;
85
+ $medium-font-size: 1.25rem;
86
+ $normal-font-size: 1rem;
87
+ $small-font-size: 0.875rem;
88
+ ```
@@ -0,0 +1,20 @@
1
+ @use './mixins/text-transform' as *;
2
+ @use './mixins/font-weight' as *;
3
+ @use './mixins/text-truncate' as *;
4
+
5
+ .embolden { /* stylelint-disable-line selector-class-pattern */
6
+ @include embolden();
7
+ }
8
+
9
+ .uppercase { /* stylelint-disable-line selector-class-pattern */
10
+ text-transform: uppercase;
11
+ }
12
+
13
+ // deprecate in v1.0
14
+ .single-line-ellipsis { /* stylelint-disable-line selector-class-pattern */
15
+ @include single-line-ellipsis();
16
+ }
17
+
18
+ .text-truncate { /* stylelint-disable-line selector-class-pattern */
19
+ @include text-truncate();
20
+ }
@@ -0,0 +1,5 @@
1
+ @forward 'mixins/font-weight';
2
+ @forward 'mixins/sizes';
3
+ @forward 'mixins/text-transform';
4
+ @forward 'mixins/text-truncate';
5
+ @forward 'utilities';
@@ -0,0 +1,18 @@
1
+ @use '../utilities/variables';
2
+
3
+ //
4
+ // @docs
5
+ //
6
+ // Changes the weight of text to bold
7
+ //
8
+ // @usage
9
+ // ```scss
10
+ // @use '@daffodil/design/scss/typography;
11
+ //
12
+ // @include typography.embolden;
13
+ // ```
14
+ //
15
+
16
+ @mixin embolden() {
17
+ font-weight: variables.$bold-font-weight;
18
+ }
@@ -0,0 +1,84 @@
1
+ @use '../../layout' as layout;
2
+ @use 'font-weight';
3
+
4
+ @mixin headline-xl() {
5
+ @include font-weight.embolden;
6
+ font-size: 2.5rem;
7
+ line-height: 2.75rem;
8
+
9
+ @include layout.breakpoint(tablet) {
10
+ font-size: 3.5rem;
11
+ line-height: 4rem;
12
+ }
13
+ }
14
+
15
+ @mixin headline-lg() {
16
+ @include font-weight.embolden;
17
+ font-size: 2rem;
18
+ line-height: 2.25rem;
19
+
20
+ @include layout.breakpoint(tablet) {
21
+ font-size: 3rem;
22
+ line-height: 3.5rem;
23
+ }
24
+ }
25
+
26
+ @mixin headline-md() {
27
+ @include font-weight.embolden;
28
+ font-size: 1.5rem;
29
+ line-height: 1.75rem;
30
+
31
+ @include layout.breakpoint(tablet) {
32
+ font-size: 2rem;
33
+ line-height: 2.5rem;
34
+ }
35
+ }
36
+
37
+ @mixin headline-sm() {
38
+ @include font-weight.embolden;
39
+ font-size: 1.25rem;
40
+ line-height: 1.5rem;
41
+
42
+ @include layout.breakpoint(tablet) {
43
+ font-size: 1.5rem;
44
+ line-height: 2rem;
45
+ }
46
+ }
47
+
48
+ @mixin body-lg() {
49
+ font-size: 1.5rem;
50
+ font-weight: 400;
51
+ line-height: 2rem;
52
+ }
53
+
54
+ @mixin body-md() {
55
+ font-size: 1.25rem;
56
+ font-weight: 400;
57
+ line-height: 1.75rem;
58
+ }
59
+
60
+ @mixin body-sm() {
61
+ font-size: 1rem;
62
+ font-weight: 400;
63
+ line-height: 1.5rem;
64
+ }
65
+
66
+ @mixin body-xs() {
67
+ font-size: 0.875rem;
68
+ font-weight: 400;
69
+ line-height: 1.25rem;
70
+ }
71
+
72
+ @mixin subheading() {
73
+ font-size: 0.875rem;
74
+ font-weight: 600;
75
+ letter-spacing: 0.03125rem;
76
+ line-height: 1rem;
77
+ text-transform: uppercase;
78
+ }
79
+
80
+ @mixin caption() {
81
+ font-size: 0.75rem;
82
+ line-height: 1rem;
83
+ font-weight: 400;
84
+ }
@@ -0,0 +1,4 @@
1
+ // @deprecated in v1.0.0
2
+ @mixin uppercase() {
3
+ text-transform: uppercase;
4
+ }
@@ -0,0 +1,23 @@
1
+ // @docs
2
+ //
3
+ // Forces a line of text to ellipsis once it reaches the
4
+ // width of its container. It should only be used if the element
5
+ // is `display: block` or `display: inline-block`.
6
+ // @usage
7
+ // ```scss
8
+ // @use '@daffodil/design/scss/typography;'
9
+ //
10
+ // @include typography.text-truncate;
11
+ // ```
12
+
13
+ // @deprecated in v1.0 in favor of text-truncate
14
+ @mixin single-line-ellipsis() {
15
+ @include text-truncate();
16
+ }
17
+
18
+ @mixin text-truncate() {
19
+ display: block;
20
+ overflow: hidden;
21
+ text-overflow: ellipsis;
22
+ white-space: nowrap;
23
+ }
@@ -0,0 +1 @@
1
+ @forward 'variables';
@@ -0,0 +1,12 @@
1
+ $body-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica,
2
+ Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
3
+ $base-font-family: $body-font-family;
4
+ $monospace-font-family: ui-monospace, 'SFMono-Regular', SF Mono, Menlo, Consolas,
5
+ 'Liberation Mono', monospace;
6
+
7
+ $large-font-size: 1.5rem;
8
+ $medium-font-size: 1.25rem;
9
+ $normal-font-size: 1rem;
10
+ $small-font-size: 0.875rem;
11
+
12
+ $bold-font-weight: bold;
@@ -1,15 +1,16 @@
1
1
  # Button
2
2
  The button is used for making actions apparent to the end-user. It can be used to navigate users to a different page or to perform an action. Buttons can contain text, icons, or both.
3
3
 
4
+ ## Overview
4
5
  Native `<button>` or `<a>` elements are always used in order to provide an easy, accessible experience for users.
5
6
  - `<a>` should be used for interactions that will navigate users to a new page or to a different target on the same page.
6
7
  - `<button>` should be used when a clickable action is performed within the same page.
7
8
 
8
9
  ## Types
9
- - `daff-button` -- Rectangular contained button with background color
10
- - `daff-icon-button` -- Icon button used with icon fonts
10
+ - `daff-button` - Rectangular contained button with background color
11
+ - `daff-icon-button` - Icon button used with icon fonts
11
12
  - `daff-raised-button` - Rectangular contained button with background color and elevation
12
- - `daff-stroked-button` -- Rectangular outlined button with no background color
13
+ - `daff-stroked-button` - Rectangular outlined button with no background color
13
14
 
14
15
  ### Basic Button
15
16
  <design-land-example-viewer-container example="basic-button"></design-land-example-viewer-container>
@@ -17,21 +18,32 @@ Native `<button>` or `<a>` elements are always used in order to provide an easy,
17
18
  ### Stroked Button
18
19
  <design-land-example-viewer-container example="stroked-button"></design-land-example-viewer-container>
19
20
 
21
+ > `black`, `white`, and `theme` should be used with caution to ensure that there is sufficient contrast.
22
+
20
23
  ### Raised Button
21
24
  <design-land-example-viewer-container example="raised-button"></design-land-example-viewer-container>
22
25
 
23
26
  ### Icon Button
24
27
  <design-land-example-viewer-container example="icon-button"></design-land-example-viewer-container>
25
28
 
29
+ > `black`, `white`, and `theme` should be used with caution to ensure that there is sufficient contrast.
30
+
26
31
  ### Underline Button
27
32
  <design-land-example-viewer-container example="underline-button"></design-land-example-viewer-container>
28
33
 
34
+ ## Sizes
35
+ The size of a button can be changed by using the `size` property. The size of all the button variants will default to `md` if no size is defined. This can be changed to one of the supported sizes.
36
+
37
+ Supported Sizes: `sm | md | lg`
38
+
39
+ <design-land-example-viewer-container example="sizeable-button"></design-land-example-viewer-container>
40
+
29
41
  ## Theming
30
42
  The default color of a button is light gray, but it can be updated to one of the supported colors by using the `color` property.
31
43
 
32
44
  Supported colors: `primary | secondary | tertiary | black | white | theme | theme-contrast`
33
45
 
34
- > For select button types, `white` and `theme` should be used on a darker background in order to have sufficient contrast.
46
+ > For select button types, `black` and `white` should be used on a darker background in order to have sufficient contrast.
35
47
 
36
48
  ## Status Indicators
37
49
  Buttons with status indicators can be used to distinguish what type of action it performs and its importance compared to other buttons in the same context.
@@ -40,13 +52,6 @@ Supported statuses: `warn | danger | success`
40
52
 
41
53
  <design-land-example-viewer-container example="statusable-button"></design-land-example-viewer-container>
42
54
 
43
- ## Sizes
44
- The size of a button can be changed by using the `size` property. The size of all the button variants will default to `md` if no size is defined. This can be changed to one of the supported sizes.
45
-
46
- Supported Sizes: `sm | md | lg`
47
-
48
- <design-land-example-viewer-container example="sizeable-button"></design-land-example-viewer-container>
49
-
50
55
  ## Accessbility
51
56
  Daffodil uses native `<a>` and `<button>` HTML elements to ensure an accessible experience by default. The `<button>` element should be used when a clickable action is performed within the same page. The `<a>` element should be used to navigate users to a new page or to a different target on the same page.
52
57
 
@@ -0,0 +1,35 @@
1
+ @use '../../../../scss/theming';
2
+
3
+ @mixin daff-button-theme-variant(
4
+ $base-color,
5
+ $hover-color,
6
+ $active-color: $hover-color
7
+ ) {
8
+ // @if daff-contrast-ratio($base-color, daff-text-contrast($base-color)) < 4.5 {
9
+ // @error 'Button Initial State: ' + map-get($wcag-aa-errors, 'text-contrast');
10
+ // }
11
+
12
+ // @if daff-contrast-ratio($hover-color, daff-text-contrast($base-color)) < 4.5 {
13
+ // @error 'Button Hover State: ' + map-get($wcag-aa-errors, 'text-contrast');
14
+ // }
15
+
16
+ // @if daff-contrast-ratio($active-color, daff-text-contrast($base-color)) < 4.5 {
17
+ // @error 'Button Active State: ' + map-get($wcag-aa-errors, 'text-contrast');
18
+ // }
19
+ background-color: $base-color;
20
+ border: 1px solid $base-color;
21
+ color: theming.daff-text-contrast($base-color);
22
+
23
+ &:hover,
24
+ &:focus {
25
+ background-color: $hover-color;
26
+ border: 1px solid $hover-color;
27
+ color: theming.daff-text-contrast($hover-color);
28
+ }
29
+
30
+ &:active {
31
+ background-color: $active-color;
32
+ border: 1px solid $active-color;
33
+ color: theming.daff-text-contrast($active-color);
34
+ }
35
+ }
@@ -0,0 +1,6 @@
1
+ @mixin daff-button-focus-theme-variant($shadow-color) {
2
+ &:focus {
3
+ outline: none;
4
+ box-shadow: 0 0 0 4px rgba($shadow-color, 0.3);
5
+ }
6
+ }
@@ -0,0 +1,21 @@
1
+ @mixin daff-icon-button-theme-variant(
2
+ $base-color: currentColor,
3
+ $hover-color: currentColor,
4
+ $active-color: $hover-color
5
+ ) {
6
+ color: $base-color;
7
+
8
+ &:hover {
9
+ color: $hover-color;
10
+ @if $base-color == currentColor {
11
+ opacity: 0.8;
12
+ }
13
+ @else {
14
+ opacity: 1;
15
+ }
16
+ }
17
+
18
+ &:active {
19
+ color: $active-color;
20
+ }
21
+ }
@@ -0,0 +1,56 @@
1
+ @use 'sass:map';
2
+ @use '../../../../scss/core';
3
+ @use '../../../../scss/theming';
4
+ @use '../../../../scss/accessibility' as a11y;
5
+
6
+ $black: theming.daff-color(theming.$daff-gray, 110);
7
+
8
+ @mixin daff-raised-button-theme-variant(
9
+ $base-color,
10
+ $active-color,
11
+ $focus-shadow
12
+ ) {
13
+ @if theming.daff-contrast-ratio($base-color, theming.daff-text-contrast($base-color)) < 4.5 {
14
+ @error 'Button Initial State: ' + map.get(a11y.$wcag-aa-errors, 'text-contrast');
15
+ }
16
+
17
+ @if theming.daff-contrast-ratio($base-color, theming.daff-text-contrast($base-color)) < 4.5 {
18
+ @error 'Button Hover State: '+ map.get(a11y.$wcag-aa-errors, 'text-contrast');
19
+ }
20
+
21
+ @if theming.daff-contrast-ratio($active-color, theming.daff-text-contrast($active-color)) < 4.5 {
22
+ @error 'Button Active State: ' + map.get(a11y.$wcag-aa-errors, 'text-contrast');
23
+ }
24
+ background-color: $base-color;
25
+ border: 1px solid $base-color;
26
+ box-shadow:
27
+ 0 3px 5px rgba($black, 0.12),
28
+ 0 1px 3px rgba($black, 0.08);
29
+ color: theming.daff-text-contrast($base-color);
30
+
31
+ &:hover {
32
+ background-color: $base-color;
33
+ border: 1px solid $base-color;
34
+ }
35
+
36
+ &:hover,
37
+ &:active {
38
+ box-shadow:
39
+ 0 6px 12px rgba($black, 0.12),
40
+ 0 4px 6px rgba($black, 0.1);
41
+ }
42
+
43
+ &:focus {
44
+ outline: none;
45
+ box-shadow:
46
+ 0 0 0 4px rgba($focus-shadow, 0.3),
47
+ 0 6px 12px rgba($black, 0.12),
48
+ 0 4px 6px rgba($black, 0.1);
49
+ }
50
+
51
+ &:active {
52
+ background-color: $active-color;
53
+ border: 1px solid $active-color;
54
+ color: theming.daff-text-contrast($active-color);
55
+ }
56
+ }
@@ -0,0 +1,36 @@
1
+ @use 'sass:map';
2
+ @use '../../../../scss/theming';
3
+
4
+ @mixin daff-stroked-button-theme-variant(
5
+ $base-color,
6
+ $font-color,
7
+ $focus-color
8
+ ) {
9
+ // @if daff-contrast-ratio($base-color, daff-text-contrast($base-color)) < 4.5 {
10
+ // @error 'Stroked Button Hover State: ' + map.get($wcag-aa-errors, 'text-contrast');
11
+ // }
12
+
13
+ // @if daff-contrast-ratio($focus-color, daff-text-contrast($focus-color)) < 4.5 {
14
+ // @error 'Stroked Button Focus State: ' + map.get($wcag-aa-errors, 'text-contrast');
15
+ // }
16
+
17
+ // @if daff-contrast-ratio($focus-color, daff-text-contrast($focus-color)) < 4.5 {
18
+ // @error 'Stroked Button Active State: ' + map.get($wcag-aa-errors, 'text-contrast');
19
+ // }
20
+ border: 1px solid $base-color;
21
+ color: $font-color;
22
+ background-color: transparent;
23
+
24
+ &:hover,
25
+ &:focus {
26
+ background-color: $base-color;
27
+ border: 1px solid $base-color;
28
+ color: theming.daff-text-contrast($base-color);
29
+ }
30
+
31
+ &:active {
32
+ background-color: $focus-color;
33
+ border: 1px solid $focus-color;
34
+ color: theming.daff-text-contrast($focus-color);
35
+ }
36
+ }
@@ -0,0 +1,9 @@
1
+ @mixin daff-underline-button-theme-variant(
2
+ $base-color: currentColor,
3
+ ) {
4
+ color: $base-color;
5
+
6
+ &::after {
7
+ background-color: $base-color;
8
+ }
9
+ }