cacao-css 3.17.0 → 3.19.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.19.0 (April 28, 2023)
4
+
5
+ - Updated more hover states to only be applied if hover is supported by the device.
6
+
7
+ ## 3.18.0 (April 28, 2023)
8
+
9
+ - Updated hover states to only be applied if hover is supported by the device.
10
+
3
11
  ## 3.17.0 (July 28, 2022)
4
12
 
5
13
  - Added u-size1of1 as an alternate class to u-sizeFull.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cacao-css",
3
3
  "description": "A set of composable CSS modules that provide a solid foundation for starting a new project.",
4
- "version": "3.17.0",
4
+ "version": "3.19.0",
5
5
  "main": "gulfile.js",
6
6
  "author": "Aptuitiv, Inc <hello@aptuitiv.com>",
7
7
  "license": "MIT",
@@ -103,13 +103,16 @@ textarea {
103
103
  /**
104
104
  * Work around a Firefox/IE bug where the transparent `button` background
105
105
  * results in a loss of the default `button` focus styles.
106
+ * Based on SUIT CSS: https://github.com/suitcss/base/blob/master/lib/base.css.
107
+ * Also see https://css-tricks.com/copy-the-browsers-native-focus-styles/ for "Highlight"
106
108
  */
107
-
108
- button:focus {
109
+ button:focus-visible {
109
110
  outline: 1px dotted;
110
111
  /* stylelint-disable */
111
- outline: 5px auto -webkit-focus-ring-color;
112
+ outline: 2px auto Highlight;
113
+ outline: 2px auto -webkit-focus-ring-color;
112
114
  /* stylelint-enable */
115
+ outline-offset: 1px;
113
116
  }
114
117
 
115
118
  /**
@@ -130,3 +133,13 @@ button:focus {
130
133
  *::after {
131
134
  box-sizing: border-box;
132
135
  }
136
+
137
+ /**
138
+ * Remove the focus outline for mouse uses but preserve for keyboard users with
139
+ * :focus-visible
140
+ * @link https://twitter.com/LeaVerou/status/1045768279753666562
141
+ * @link https://css-tricks.com/the-focus-visible-trick/
142
+ */
143
+ :focus:not(:focus-visible) {
144
+ outline: none;
145
+ }
@@ -64,32 +64,37 @@
64
64
  /**
65
65
  * Work around a Firefox/IE bug where the transparent `button` background
66
66
  * results in a loss of the default `button` focus styles.
67
+ * Based on SUIT CSS: https://github.com/suitcss/base/blob/master/lib/base.css.
68
+ * Also see https://css-tricks.com/copy-the-browsers-native-focus-styles/ for "Highlight"
67
69
  */
68
-
69
- .Button:focus {
70
+ .Button:focus-visible {
70
71
  outline: 1px dotted;
71
72
  /* stylelint-disable */
72
- outline: 5px auto -webkit-focus-ring-color;
73
+ outline: 2px auto Highlight;
74
+ outline: 2px auto -webkit-focus-ring-color;
73
75
  /* stylelint-enable */
76
+ outline-offset: 1px;
74
77
  }
75
78
 
76
79
  /**
77
80
  * UI States
78
81
  */
79
82
 
80
- .Button:hover,
81
- .Button:focus,
82
- .Button:active {
83
+ /* Only show hover states if supported */
84
+ @media (hover: hover) and (pointer: fine) {
85
+ .Button:hover:not(:disabled) {
86
+ background: var(--Button-backgroundHover);
87
+ color: var(--Button-colorHover);
88
+ text-decoration: none;
89
+ }
90
+ }
91
+
92
+ .Button:focus-visible {
83
93
  background: var(--Button-backgroundHover);
84
94
  color: var(--Button-colorHover);
85
95
  text-decoration: none;
86
96
  }
87
97
 
88
- .Button:focus,
89
- .Button:active {
90
- box-shadow: inset 0 0 10px rgba(0, 0, 0, .5);
91
- }
92
-
93
98
  .Button:disabled,
94
99
  .Button.is-disabled {
95
100
  cursor: default;
@@ -118,9 +123,14 @@
118
123
  background: #555;
119
124
  }
120
125
 
121
- .Button--secondary:active,
122
- .Button--secondary:focus,
123
- .Button--secondary:hover {
126
+ /* Only show hover states if supported */
127
+ @media (hover: hover) and (pointer: fine) {
128
+ .Button--secondary:hover {
129
+ background: #333;
130
+ }
131
+ }
132
+
133
+ .Button--secondary:focus-visible {
124
134
  background: #333;
125
135
  }
126
136
 
@@ -54,10 +54,16 @@
54
54
  transform: translateY(-50%) rotate(90deg);
55
55
  }
56
56
 
57
+ @media (hover: hover) and (pointer: fine) {
58
+ .MainNav-link:hover {
59
+ background: rgba(0, 0, 0, .1);
60
+ color: inherit;
61
+ text-decoration: none;
62
+ }
63
+ }
64
+
57
65
  .MainNav-link.is-active,
58
- .MainNav-link:active,
59
- .MainNav-link:focus,
60
- .MainNav-link:hover {
66
+ .MainNav-link:focus-visible {
61
67
  background: rgba(0, 0, 0, .1);
62
68
  color: inherit;
63
69
  text-decoration: none;
@@ -88,17 +94,28 @@
88
94
  white-space: normal;
89
95
  }
90
96
 
91
- .Dropdown-link:active,
92
- .Dropdown-link:hover,
93
- .Dropdown-link:focus {
97
+ @media (hover: hover) and (pointer: fine) {
98
+ .Dropdown-link:hover {
99
+ color: var(--Dropdown-link-color);
100
+ text-decoration: none;
101
+ }
102
+ }
103
+
104
+ .Dropdown-link:focus-visible {
94
105
  color: var(--Dropdown-link-color);
95
106
  text-decoration: none;
96
107
  }
97
108
 
109
+ @media (hover: hover) and (pointer: fine) {
110
+ .Dropdown-link--parent:hover {
111
+ background: rgba(0, 0, 0, .1);
112
+ color: inherit;
113
+ text-decoration: none;
114
+ }
115
+ }
116
+
98
117
  .Dropdown-link--parent.is-active,
99
- .Dropdown-link--parent:active,
100
- .Dropdown-link--parent:focus,
101
- .Dropdown-link--parent:hover,
118
+ .Dropdown-link--parent:focus-visible,
102
119
  .Dropdown-link--parent.is-active + .Dropdown-menu {
103
120
  background: rgba(0, 0, 0, .1);
104
121
  color: inherit;
@@ -56,10 +56,16 @@
56
56
  transform: translateY(-50%) rotate(90deg);
57
57
  }
58
58
 
59
+ @media (hover: hover) and (pointer: fine) {
60
+ .MainNav-link:hover {
61
+ background: rgba(0, 0, 0, .1);
62
+ color: inherit;
63
+ text-decoration: none;
64
+ }
65
+ }
66
+
59
67
  .MainNav-link.is-active,
60
- .MainNav-link:active,
61
- .MainNav-link:focus,
62
- .MainNav-link:hover {
68
+ .MainNav-link:focus-visible {
63
69
  background: rgba(0, 0, 0, .1);
64
70
  color: inherit;
65
71
  text-decoration: none;
@@ -90,17 +96,28 @@
90
96
  white-space: normal;
91
97
  }
92
98
 
93
- .Dropdown-link:active,
94
- .Dropdown-link:hover,
95
- .Dropdown-link:focus {
99
+ @media (hover: hover) and (pointer: fine) {
100
+ .Dropdown-link:hover {
101
+ color: var(--Dropdown-link-color);
102
+ text-decoration: none;
103
+ }
104
+ }
105
+
106
+ .Dropdown-link:focus-visible {
96
107
  color: var(--Dropdown-link-color);
97
108
  text-decoration: none;
98
109
  }
99
110
 
111
+ @media (hover: hover) and (pointer: fine) {
112
+ .Dropdown-link--parent:hover {
113
+ background: rgba(0, 0, 0, .1);
114
+ color: inherit;
115
+ text-decoration: none;
116
+ }
117
+ }
118
+
100
119
  .Dropdown-link--parent.is-active,
101
- .Dropdown-link--parent:active,
102
- .Dropdown-link--parent:focus,
103
- .Dropdown-link--parent:hover,
120
+ .Dropdown-link--parent:focus-visible,
104
121
  .Dropdown-link--parent.is-active + .Dropdown-menu {
105
122
  background: rgba(0, 0, 0, .1);
106
123
  color: inherit;
@@ -25,9 +25,14 @@
25
25
  text-decoration: none;
26
26
  }
27
27
 
28
- .SidebarNav-link:active,
29
- .SidebarNav-link:focus,
30
- .SidebarNav-link:hover {
28
+ @media (hover: hover) and (pointer: fine) {
29
+ .SidebarNav-link:hover {
30
+ color: #333;
31
+ text-decoration: none;
32
+ }
33
+ }
34
+
35
+ .SidebarNav-link:focus-visible {
31
36
  color: #333;
32
37
  text-decoration: none;
33
38
  }
@@ -30,9 +30,15 @@
30
30
  }
31
31
  }
32
32
 
33
- .SmScBtn:active,
34
- .SmScBtn:focus,
35
- .SmScBtn:hover {
33
+ /* Only show hover states if supported */
34
+ @media (hover: hover) and (pointer: fine) {
35
+ .SmScBtn:hover {
36
+ color: #fff;
37
+ text-decoration: none;
38
+ }
39
+ }
40
+
41
+ .SmScBtn:focus-visible {
36
42
  color: #fff;
37
43
  text-decoration: none;
38
44
  }
@@ -17,9 +17,15 @@
17
17
  text-decoration: none;
18
18
  }
19
19
 
20
- .Pagination-item:active,
21
- .Pagination-item:focus,
22
- .Pagination-item:hover {
20
+ @media (hover: hover) and (pointer: fine) {
21
+ .Pagination-item:hover {
22
+ background: #666;
23
+ color: #fff;
24
+ text-decoration: none;
25
+ }
26
+ }
27
+
28
+ .Pagination-item:focus-visible {
23
29
  background: #666;
24
30
  color: #fff;
25
31
  text-decoration: none;
@@ -0,0 +1,11 @@
1
+ /* =========================================================================== *\
2
+ Content Utilities
3
+ \* =========================================================================== */
4
+
5
+ /** @define utilities */
6
+
7
+ /* Ensures the last child inside the container has no bottom margin or padding */
8
+ .u-cleanContent > *:last-child {
9
+ margin-bottom: 0 !important;
10
+ padding-bottom: 0 !important;
11
+ }
@@ -0,0 +1 @@
1
+ @import './content';
@@ -1,5 +1,6 @@
1
1
  @import './align';
2
2
  @import './background';
3
+ @import './content';
3
4
  @import './display';
4
5
  @import './flex';
5
6
  @import './image';
@@ -9,10 +9,15 @@
9
9
  * Reset all link styles
10
10
  */
11
11
 
12
+ @media (hover: hover) and (pointer: fine) {
13
+ .u-linkClean:hover {
14
+ color: inherit !important;
15
+ text-decoration: none !important;
16
+ }
17
+ }
18
+
12
19
  .u-linkClean,
13
- .u-linkClean:hover,
14
- .u-linkClean:focus,
15
- .u-linkClean:active {
20
+ .u-linkClean:focus-visible {
16
21
  color: inherit !important;
17
22
  text-decoration: none !important;
18
23
  }
@@ -66,15 +71,23 @@
66
71
  * </a>
67
72
  */
68
73
 
74
+ @media (hover: hover) and (pointer: fine) {
75
+ .u-linkComplex:hover {
76
+ text-decoration: none !important;
77
+ }
78
+ }
79
+
69
80
  .u-linkComplex,
70
- .u-linkComplex:hover,
71
- .u-linkComplex:focus,
72
- .u-linkComplex:active {
81
+ .u-linkComplex:focus-visible {
73
82
  text-decoration: none !important;
74
83
  }
75
84
 
76
- .u-linkComplex:hover .u-linkComplexTarget,
77
- .u-linkComplex:focus .u-linkComplexTarget,
78
- .u-linkComplex:active .u-linkComplexTarget {
85
+ @media (hover: hover) and (pointer: fine) {
86
+ .u-linkComplex:hover .u-linkComplexTarget {
87
+ text-decoration: underline !important;
88
+ }
89
+ }
90
+
91
+ .u-linkComplex:focus-visible .u-linkComplexTarget {
79
92
  text-decoration: underline !important;
80
93
  }