@digigov/css 0.6.1 → 0.7.2

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.
@@ -4,7 +4,7 @@
4
4
 
5
5
  }
6
6
  .govgr-header__container {
7
- @apply container px-4 py-2 max-w-5xl flex justify-between items-center;
7
+ @apply px-4 py-2 mx-auto max-w-5xl w-full flex justify-between items-center;
8
8
  }
9
9
  .govgr-header__container-full {
10
10
  @apply max-w-full;
@@ -20,11 +20,9 @@
20
20
  }
21
21
 
22
22
  .govgr-header-title:focus {
23
- @apply text-gray-900;
24
- background-color: #fd0;
25
- box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
26
23
  text-decoration:none;
27
- outline: none;
24
+ outline: 4px solid var(--color-focus);
25
+ outline-offset: 4px;
28
26
  }
29
27
  .govgr-header-logo {
30
28
  @apply h-12;
@@ -33,9 +31,9 @@
33
31
  @apply h-10;
34
32
  }
35
33
  .govgr-header-link:focus{
36
- box-shadow: 0px 0px 0px 4px #fd0;
37
- -webkit-box-shadow: 0px 0px 0px 4px #fd0;
38
- -moz-box-shadow: 0px 0px 0px 4px #fd0;
34
+ box-shadow: 0px 0px 0px 4px var(--color-focus);
35
+ -webkit-box-shadow: 0px 0px 0px 4px var(--color-focus);
36
+ -moz-box-shadow: 0px 0px 0px 4px var(--color-focus);
39
37
  outline: none;
40
38
  text-decoration: none;
41
39
  }
@@ -65,8 +65,8 @@
65
65
  }
66
66
 
67
67
  .govgr-horizontal-nav__item:focus {
68
- background-color: #fd0;
69
- box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
68
+ background-color: var(--color-focus);
69
+ box-shadow: 0 -2px var(--color-focus), 0 4px #0b0c0c;
70
70
  outline: none;
71
71
  }
72
72
  .govgr-horizontal-nav__item-active, .govgr-vertical-nav__item--active {
@@ -36,8 +36,8 @@
36
36
  text-decoration-thickness: 2px;
37
37
  }
38
38
  &:focus {
39
- background-color: #fd0;
40
- box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
39
+ background-color: var(--color-focus);
40
+ box-shadow: 0 -2px var(--color-focus), 0 4px #0b0c0c;
41
41
  text-decoration:none;
42
42
  outline: none;
43
43
  }
@@ -1,5 +1,5 @@
1
1
  .govgr-radios__item {
2
- @apply block relative mb-4 pl-10;
2
+ @apply block relative mb-4 pl-12;
3
3
  min-height: 40px;
4
4
 
5
5
  }
@@ -45,13 +45,6 @@
45
45
  background: currentColor;
46
46
  }
47
47
  &:checked {
48
- &:before {
49
- /* border-width: 4px;
50
- outline: 3px solid transparent;
51
- outline-offset: 1px;
52
- -webkit-box-shadow: 0 0 0 3px #fd0;
53
- box-shadow: 0 0 0 3px #fd0; */
54
- }
55
48
  &:after {
56
49
  opacity: 1;
57
50
  }
@@ -61,7 +54,7 @@
61
54
  &:before {
62
55
  outline: 3px solid transparent;
63
56
  outline-offset: 1px;
64
- box-shadow: 0 0 0 3px #fd0;
57
+ box-shadow: 0 0 0 4px var(--color-focus);
65
58
  border-width: 4px;
66
59
  }
67
60
  }
@@ -39,10 +39,10 @@
39
39
  left: 0;
40
40
  }
41
41
  &:focus {
42
- background-color: #fd0;
42
+ background-color: var(--color-focus);
43
43
  outline: 3px solid transparent;
44
- -webkit-box-shadow: inset 0 0 0 3px #fd0;
45
- box-shadow: inset 0 0 0 3px #fd0;
44
+ -webkit-box-shadow: inset 0 0 0 3px var(--color-focus);
45
+ box-shadow: inset 0 0 0 3px var(--color-focus);
46
46
  outline-offset: 0px;
47
47
  text-decoration-thickness: .2rem;
48
48
  }
@@ -101,8 +101,8 @@
101
101
  text-decoration-thickness: 2px;
102
102
  }
103
103
  &:focus {
104
- background-color: #fd0;
105
- box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
104
+ background-color: var(--color-focus);
105
+ box-shadow: 0 -2px var(--color-focus), 0 4px #0b0c0c;
106
106
  text-decoration:none;
107
107
  outline: none;
108
108
  }
@@ -131,8 +131,8 @@
131
131
  text-decoration-thickness: 2px;
132
132
  }
133
133
  &:focus {
134
- background-color: #fd0;
135
- box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
134
+ background-color: var(--color-focus);
135
+ box-shadow: 0 -2px var(--color-focus), 0 4px #0b0c0c;
136
136
  text-decoration:none;
137
137
  outline: none;
138
138
  }
@@ -63,4 +63,19 @@
63
63
  }
64
64
  .govgr-grid__col-span-12 {
65
65
  @apply col-span-12;
66
+ }
67
+ .govgr-lg-up {
68
+ @apply lg:hidden;
69
+ }
70
+ .govgr-md-up {
71
+ @apply md:hidden;
72
+ }
73
+ .govgr-sm-up {
74
+ @apply sm:hidden;
75
+ }
76
+ .govgr-xl-up {
77
+ @apply xl:hidden;
78
+ }
79
+ .govgr-xs-up {
80
+ @apply xs:hidden;
66
81
  }
@@ -69,4 +69,19 @@
69
69
  .govgr-grid__col-span-12 {
70
70
  @apply col-span-12;
71
71
  }
72
+ .govgr-lg-up {
73
+ @apply lg:hidden;
74
+ }
75
+ .govgr-md-up {
76
+ @apply md:hidden;
77
+ }
78
+ .govgr-sm-up {
79
+ @apply sm:hidden;
80
+ }
81
+ .govgr-xl-up {
82
+ @apply xl:hidden;
83
+ }
84
+ .govgr-xs-up {
85
+ @apply xs:hidden;
86
+ }
72
87
  };
@@ -1,4 +1,6 @@
1
1
  const defaultTheme = require('tailwindcss/defaultTheme')
2
+ const colors = require('./colors');
3
+
2
4
  const buildOnly = !process.env['DIGIGOV_CSS_BUILD'] ? {
3
5
  mode: 'jit',
4
6
  } : {}
@@ -91,6 +93,25 @@ module.exports = {
91
93
  borderColor: ['active']
92
94
  }
93
95
  },
96
+ plugins: [
97
+ function({ addBase, theme }) {
98
+ function extractColorVars(colorObj, colorGroup = '') {
99
+ return Object.keys(colorObj).reduce((vars, colorKey) => {
100
+ const value = colorObj[colorKey];
101
+
102
+ const newVars =
103
+ typeof value === 'string'
104
+ ? { [`--color${colorGroup}-${colorKey}`]: value }
105
+ : extractColorVars(value, `-${colorKey}`);
106
+
107
+ return { ...vars, ...newVars };
108
+ }, {});
109
+ }
110
+ addBase({
111
+ ':root': extractColorVars(theme('colors')),
112
+ });
113
+ },
114
+ ],
94
115
  // corePlugins: [
95
116
  // 'animation',
96
117
  // 'backgroundColor',
package/colors/windi.js DELETED
@@ -1,12 +0,0 @@
1
- const colorValues = require('./color-values')
2
-
3
- let colorObject = {
4
- "transparent": "transparent",
5
- "current": "currentColor",
6
- }
7
-
8
- for (const [key, item] of Object.entries(colorValues)) {
9
- colorObject[key] = `hsla(var(--${item.name}, ${item.value}) / var(--tw-bg-opacity, 1))`
10
- }
11
-
12
- module.exports = colorObject