@graupl/graupl 1.0.0-alpha.7 → 1.0.0-alpha.8

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.
@@ -17,17 +17,10 @@ $content-max-width: 96ch !default;
17
17
 
18
18
  // Screen sizes.
19
19
  $base-screen-sizes: (
20
- xs: 0,
21
- sm: 469px,
22
- md: 768px,
23
- lg: 1024px,
24
- xl: 1280px,
25
- hd: 1920px,
26
- qhd: 2560px,
27
- uhd: 3840px,
28
- ) !default;
20
+ xs: "(0 <= width <= 48ch)",
21
+ );
29
22
  $custom-screen-sizes: () !default;
30
- $screen-sizes: map.merge($base-screen-sizes, $custom-screen-sizes) !default;
23
+ $screen-sizes: map.merge($base-screen-sizes, $custom-screen-sizes);
31
24
 
32
25
  // Spacing properties.
33
26
  $spacer: 1rem !default;
@@ -43,12 +36,12 @@ $base-spacer-multipliers: (
43
36
  8: 3,
44
37
  9: 5,
45
38
  10: 10,
46
- ) !default;
39
+ );
47
40
  $custom-spacer-multipliers: () !default;
48
41
  $spacer-multipliers: map.merge(
49
42
  $base-spacer-multipliers,
50
43
  $custom-spacer-multipliers
51
- ) !default;
44
+ );
52
45
 
53
46
  // Size properties.
54
47
  $interactive-min-width: 44px !default;
@@ -60,10 +53,15 @@ $border-width: 2px !default;
60
53
  $border-style: solid !default;
61
54
 
62
55
  // Transition properties.
63
- $transition-duration-base: 100;
64
- $transition-duration: (
56
+ $transition-duration-base: 100 !default;
57
+ $transition-timing-function: ease !default;
58
+ $base-transition-durations: (
65
59
  fast: #{$transition-duration-base * 1.5}ms,
66
60
  default: #{$transition-duration-base * 2.5}ms,
67
61
  slow: #{$transition-duration-base * 3}ms,
68
- ) !default;
69
- $transition-timing-function: ease !default;
62
+ );
63
+ $custom-transition-durations: () !default;
64
+ $transition-durations: map.merge(
65
+ $base-transition-durations,
66
+ $custom-transition-durations
67
+ );
@@ -30,21 +30,21 @@ $border-width: var(--#{defaults.$prefix}-border-width, defaults.$border-width);
30
30
  $border-style: var(--#{defaults.$prefix}-border-style, defaults.$border-style);
31
31
 
32
32
  // Transition properties.
33
- $transition-duration: (
33
+ $transition-durations: (
34
34
  fast:
35
35
  var(
36
36
  --#{defaults.$prefix}-transition-duration-fast,
37
- map.get(defaults.$transition-duration, fast)
37
+ map.get(defaults.$transition-durations, fast)
38
38
  ),
39
39
  default:
40
40
  var(
41
41
  --#{defaults.$prefix}-transition-duration-default,
42
- map.get(defaults.$transition-duration, default)
42
+ map.get(defaults.$transition-durations, default)
43
43
  ),
44
44
  slow:
45
45
  var(
46
46
  --#{defaults.$prefix}-transition-duration-slow,
47
- map.get(defaults.$transition-duration, slow)
47
+ map.get(defaults.$transition-durations, slow)
48
48
  ),
49
49
  );
50
50
  $transition-timing-function: var(
@@ -5,4 +5,4 @@
5
5
  // which can be found in the `variables.scss` file.
6
6
 
7
7
  // Table properties.
8
- $caption-side: bottom !default;
8
+ $table-caption-side: bottom !default;
@@ -10,31 +10,31 @@
10
10
  // Table caption properties.
11
11
  $table-caption-side: var(
12
12
  --#{root-defaults.$prefix}-table-caption-side,
13
- #{defaults.$caption-side}
14
- ) !default;
13
+ #{defaults.$table-caption-side}
14
+ );
15
15
  $table-caption-padding-x: var(
16
16
  --#{root-defaults.$prefix}-table-caption-padding-x,
17
17
  #{map.get(root-variables.$spacers, 3)}
18
- ) !default;
18
+ );
19
19
  $table-caption-padding-y: var(
20
20
  --#{root-defaults.$prefix}-table-caption-padding-y,
21
21
  #{map.get(root-variables.$spacers, 3)}
22
- ) !default;
22
+ );
23
23
  $table-caption-padding: $table-caption-padding-y $table-caption-padding-x;
24
24
 
25
25
  // Table header properties.
26
26
  $table-header-font-weight: var(
27
27
  --#{root-defaults.$prefix}-table-header-font-weight,
28
28
  #{typography.$font-weight-bold}
29
- ) !default;
29
+ );
30
30
  $table-header-padding-x: var(
31
31
  --#{root-defaults.$prefix}-table-header-padding-x,
32
32
  #{map.get(root-variables.$spacers, 3)}
33
- ) !default;
33
+ );
34
34
  $table-header-padding-y: var(
35
35
  --#{root-defaults.$prefix}-table-header-padding-y,
36
36
  #{map.get(root-variables.$spacers, 3)}
37
- ) !default;
37
+ );
38
38
  $table-header-padding: $table-header-padding-y $table-header-padding-x;
39
39
  $table-header-background: var(
40
40
  --#{root-defaults.$prefix}-table-header-background,
@@ -49,11 +49,11 @@ $table-header-color: var(
49
49
  $table-cell-padding-x: var(
50
50
  --#{root-defaults.$prefix}-table-cell-padding-x,
51
51
  #{map.get(root-variables.$spacers, 3)}
52
- ) !default;
52
+ );
53
53
  $table-cell-padding-y: var(
54
54
  --#{root-defaults.$prefix}-table-cell-padding-y,
55
55
  #{map.get(root-variables.$spacers, 3)}
56
- ) !default;
56
+ );
57
57
  $table-cell-padding: $table-cell-padding-y $table-cell-padding-x;
58
58
  $table-cell-background: var(
59
59
  --#{root-defaults.$prefix}-table-cell-background,
@@ -4,7 +4,36 @@
4
4
  // They are mainly used to provide default fallbacks for custom properties
5
5
  // which can be found in the `variables.scss` file.
6
6
 
7
+ @use "sass:map";
8
+
7
9
  $button-hover-transform: none !default;
8
10
  $button-hover-transform-reduced-motion: none !default;
9
11
  $button-active-transform: scale(0.95) !default;
10
12
  $button-active-transform-reduced-motion: scale(0.98) !default;
13
+
14
+ // Button state theme defaults.
15
+ // This map is used to define the default colour shades for the
16
+ // themed button components.
17
+ //
18
+ // e.g.
19
+ // Primary buttons will use primary--900 as the text colour, primary--100 as the background
20
+ // and primary--900 as the border colour.
21
+ //
22
+ // Secondary/tertiary buttons will use the same shade for their respective colours.
23
+ $base-button-state-theme-map: (
24
+ color: 900,
25
+ border-color: 700,
26
+ hover-color: 100,
27
+ hover-background: 700,
28
+ hover-border-color: 700,
29
+ active-color: 100,
30
+ active-background: 700,
31
+ active-border-color: 700,
32
+ disabled-color: 200,
33
+ disabled-border-color: 200,
34
+ );
35
+ $custom-button-state-theme-map: () !default;
36
+ $button-state-theme-map: map.merge(
37
+ $base-button-state-theme-map,
38
+ $custom-button-state-theme-map
39
+ );
@@ -1,5 +1,6 @@
1
1
  // Graupl Button Component.
2
2
 
3
+ @use "defaults";
3
4
  @use "../../defaults" as root-defaults;
4
5
  @use "../../theme/color/variables" as color;
5
6
  @use "variables" as *;
@@ -88,31 +89,9 @@
88
89
 
89
90
  @each $color, $map in color.$theme-active {
90
91
  &.#{$color} {
91
- --#{root-defaults.$prefix}-button-color: #{map.get($map, 900)};
92
- --#{root-defaults.$prefix}-button-hover-color: #{map.get($map, 100)};
93
- --#{root-defaults.$prefix}-button-active-color: #{map.get($map, 100)};
94
- --#{root-defaults.$prefix}-button-disabled-color: #{map.get($map, 200)};
95
- --#{root-defaults.$prefix}-button-hover-background: #{map.get(
96
- $map,
97
- 700
98
- )};
99
- --#{root-defaults.$prefix}-button-active-background: #{map.get(
100
- $map,
101
- 700
102
- )};
103
- --#{root-defaults.$prefix}-button-border-color: #{map.get($map, 700)};
104
- --#{root-defaults.$prefix}-button-hover-border-color: #{map.get(
105
- $map,
106
- 700
107
- )};
108
- --#{root-defaults.$prefix}-button-active-border-color: #{map.get(
109
- $map,
110
- 700
111
- )};
112
- --#{root-defaults.$prefix}-button-disabled-border-color: #{map.get(
113
- $map,
114
- 200
115
- )};
92
+ @each $prop, $shade in defaults.$button-state-theme-map {
93
+ --#{root-defaults.$prefix}-button-#{$prop}: #{map.get($map, $shade)};
94
+ }
116
95
  }
117
96
  }
118
97
  }
@@ -34,16 +34,14 @@ $button-font-size: var(
34
34
  );
35
35
  $button-transition: var(
36
36
  --#{root-defaults.$prefix}-button-transition,
37
- background #{map.get(root-variables.$transition-duration, fast)} #{root-variables.$transition-timing-function},
38
- color #{map.get(root-variables.$transition-duration, fast)} #{root-variables.$transition-timing-function},
39
- border-color #{map.get(root-variables.$transition-duration, fast)} #{root-variables.$transition-timing-function},
40
- transform #{map.get(root-variables.$transition-duration, fast)} #{root-variables.$transition-timing-function}
37
+ background #{map.get(root-variables.$transition-durations, fast)} #{root-variables.$transition-timing-function},
38
+ color #{map.get(root-variables.$transition-durations, fast)} #{root-variables.$transition-timing-function},
39
+ transform #{map.get(root-variables.$transition-durations, fast)} #{root-variables.$transition-timing-function}
41
40
  );
42
41
  $button-transition-reduced-motion: var(
43
42
  --#{root-defaults.$prefix}-button-transition-reduced-motion,
44
- background #{map.get(root-variables.$transition-duration, none)} #{root-variables.$transition-timing-function},
45
- color #{map.get(root-variables.$transition-duration, none)} #{root-variables.$transition-timing-function},
46
- border-color #{map.get(root-variables.$transition-duration, none)} #{root-variables.$transition-timing-function}
43
+ background #{map.get(root-variables.$transition-durations, none)} #{root-variables.$transition-timing-function},
44
+ color #{map.get(root-variables.$transition-durations, none)} #{root-variables.$transition-timing-function}
47
45
  );
48
46
 
49
47
  // Transform properties.
@@ -35,7 +35,7 @@
35
35
  }
36
36
  }
37
37
 
38
- @include screen-under(sm) {
38
+ @include screen(xs) {
39
39
  .input-group.inline {
40
40
  grid-template-areas: $input-group-grid-template-areas;
41
41
  grid-template-columns: $input-group-grid-template-columns;
@@ -3,3 +3,28 @@
3
3
  // Generally, these should not be used directly when styling components.
4
4
  // They are mainly used to provide default fallbacks for custom properties
5
5
  // which can be found in the `variables.scss` file.
6
+
7
+ @use "sass:map";
8
+
9
+ // Table theme defaults.
10
+ // This map is used to define the default colour shades for the
11
+ // themed table components.
12
+ //
13
+ // e.g.
14
+ // Primary tables will use primary--700 as the header background,
15
+ // and primary--100 as the header text colour.
16
+ //
17
+ // Secondary/tertiary tables will use the same shade for their respective colours.
18
+ $base-table-theme-map: (
19
+ header-background: 700,
20
+ header-color: 100,
21
+ striped-background: 200,
22
+ striped-color: 900,
23
+ hover-background: 300,
24
+ hover-color: 900,
25
+ border-color: 900,
26
+ highlight-background: 500,
27
+ highlight-color: 100,
28
+ );
29
+ $custom-table-theme-map: () !default;
30
+ $table-theme-map: map.merge($base-table-theme-map, $custom-table-theme-map);
@@ -1,6 +1,7 @@
1
1
  // Table component styles.
2
2
 
3
3
  @use "variables" as *;
4
+ @use "defaults";
4
5
  @use "../../mixins/layer" as *;
5
6
  @use "../../defaults" as root-defaults;
6
7
  @use "../../functions/theme";
@@ -10,42 +11,12 @@
10
11
  @each $variant in theme.variants() {
11
12
  &.#{$variant},
12
13
  .#{$variant} {
13
- --#{root-defaults.$prefix}-table-header-background: #{theme.get(
14
- $variant,
15
- 700
16
- )};
17
- --#{root-defaults.$prefix}-table-header-color: #{theme.get(
18
- $variant,
19
- 100
20
- )};
21
- --#{root-defaults.$prefix}-table-striped-background: #{theme.get(
22
- $variant,
23
- 200
24
- )};
25
- --#{root-defaults.$prefix}-table-striped-color: #{theme.get(
26
- $variant,
27
- 900
28
- )};
29
- --#{root-defaults.$prefix}-table-hover-background: #{theme.get(
30
- $variant,
31
- 300
32
- )};
33
- --#{root-defaults.$prefix}-table-hover-color: #{theme.get(
34
- $variant,
35
- 900
36
- )};
37
- --#{root-defaults.$prefix}-table-border-color: #{theme.get(
38
- $variant,
39
- 900
40
- )};
41
- --#{root-defaults.$prefix}-table-highlight-background: #{theme.get(
42
- $variant,
43
- 500
44
- )};
45
- --#{root-defaults.$prefix}-table-highlight-color: #{theme.get(
46
- $variant,
47
- 100
48
- )};
14
+ @each $prop, $key in defaults.$table-theme-map {
15
+ --#{root-defaults.$prefix}-table-#{$prop}: #{theme.get(
16
+ $variant,
17
+ $key
18
+ )};
19
+ }
49
20
  }
50
21
  }
51
22
 
@@ -28,7 +28,7 @@
28
28
  }
29
29
 
30
30
  // Disable columns on small screens to avoid horizontal bleeding.
31
- @include screen-under(sm) {
31
+ @include screen(xs) {
32
32
  .columns {
33
33
  --#{root-defaults.$prefix}-columns-min-width: #{defaults.$columns-max-width};
34
34
  }
@@ -20,24 +20,7 @@
20
20
  @mixin screen($size) {
21
21
  $screen-size: map.get(root-defaults.$screen-sizes, $size);
22
22
 
23
- @media screen and (min-width: $screen-size) {
24
- @content;
25
- }
26
- }
27
-
28
- @mixin screen-under($size) {
29
- $screen-size: map.get(root-defaults.$screen-sizes, $size);
30
-
31
- @media screen and (max-width: #{$screen-size - 1}) {
32
- @content;
33
- }
34
- }
35
-
36
- @mixin screen-between($min-size, $max-size) {
37
- $min-screen-size: map.get(root-defaults.$screen-sizes, $min-size);
38
- $max-screen-size: map.get(root-defaults.$screen-sizes, $max-size);
39
-
40
- @media screen and (min-width: $min-screen-size) and (max-width: #{$max-screen-size - 1}) {
23
+ @media screen and #{$screen-size} {
41
24
  @content;
42
25
  }
43
26
  }
@@ -46,7 +46,7 @@ $custom-colors: () !default;
46
46
  $colors: map.merge($default-colors, $custom-colors);
47
47
 
48
48
  // A map for reversing the shade values of the dark theme.
49
- $dark-map: (
49
+ $base-dark-map: (
50
50
  100: 900,
51
51
  200: 800,
52
52
  300: 700,
@@ -56,4 +56,6 @@ $dark-map: (
56
56
  700: 300,
57
57
  800: 200,
58
58
  900: 100,
59
- ) !default;
59
+ );
60
+ $custom-dark-map: () !default;
61
+ $dark-map: map.merge($base-dark-map, $custom-dark-map);
@@ -24,21 +24,21 @@ $base-font-size-multipliers: (
24
24
  3xl: 2.074,
25
25
  4xl: 2.488,
26
26
  5xl: 2.986,
27
- ) !default;
27
+ );
28
28
  $custom-font-size-multipliers: () !default;
29
29
  $font-size-multipliers: map.merge(
30
30
  $base-font-size-multipliers,
31
31
  $custom-font-size-multipliers
32
- ) !default;
32
+ );
33
33
 
34
34
  // Weights.
35
35
  $base-font-weights: (
36
36
  light: 300,
37
37
  normal: 400,
38
38
  bold: 700,
39
- ) !default;
39
+ );
40
40
  $custom-font-weights: () !default;
41
- $font-weights: map.merge($base-font-weights, $custom-font-weights) !default;
41
+ $font-weights: map.merge($base-font-weights, $custom-font-weights);
42
42
 
43
43
  /* stylelint-disable-next-line scss/dollar-variable-colon-space-after */
44
44
  $root-font-family:
@@ -36,9 +36,9 @@ $base-spacing-properties: (
36
36
  mis: margin-inline-start,
37
37
  mie: margin-inline-end,
38
38
  mise: margin-inline-start margin-inline-end,
39
- ) !default;
39
+ );
40
40
  $custom-spacing-properties: () !default;
41
41
  $spacing-properties: map.merge(
42
42
  $base-spacing-properties,
43
43
  $custom-spacing-properties
44
- ) !default;
44
+ );