@cfpb/cfpb-design-system 3.1.5 → 3.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfpb/cfpb-design-system",
3
- "version": "3.1.5",
3
+ "version": "3.1.6",
4
4
  "description": "CFPB's UI framework",
5
5
  "main": "src/index.js",
6
6
  "author": {
@@ -19,6 +19,6 @@
19
19
  "bugs": {
20
20
  "url": "https://github.com/cfpb/design-system/issues"
21
21
  },
22
- "gitHead": "37c1b91a345ebaf7098509a05ec1e972cbcd91c3",
22
+ "gitHead": "59f83442c41d4ca6803d22971964dab26efb0ef0",
23
23
  "type": "module"
24
24
  }
@@ -53,12 +53,12 @@ a.a-tag-filter {
53
53
  .a-tag-topic {
54
54
  display: flex;
55
55
  gap: math.div(5px, $btn-font-size) + rem;
56
-
57
- @include u-jump-link(
58
- $is-gold: true,
59
- $jump-link-text-class: 'a-tag-topic__text'
60
- );
61
56
  }
57
+ @include u-jump-link(
58
+ $jump-link-class: 'a-tag-topic',
59
+ $jump-link-text-class: 'a-tag-topic__text',
60
+ $is-gold: true
61
+ );
62
62
  @include u-jump-link-group($jump-link-class: 'a-tag-topic');
63
63
 
64
64
  .a-tag-topic__bullet {
@@ -68,7 +68,7 @@ a.a-tag-filter {
68
68
 
69
69
  // Tablet and above.
70
70
  @include respond-to-min($bp-sm-min) {
71
- .a-tag-topic__text {
71
+ a.a-tag-topic__text {
72
72
  // Colors for :link, :visited, :hover, :focus, :active
73
73
  @include u-link-colors(
74
74
  var(--gray),
@@ -79,11 +79,11 @@ a.a-tag-filter {
79
79
  );
80
80
  }
81
81
 
82
- .a-tag-topic,
83
- .a-tag-topic:visited,
84
- .a-tag-topic:hover,
85
- .a-tag-topic:focus,
86
- .a-tag-topic:active {
82
+ a.a-tag-topic,
83
+ a.a-tag-topic:visited,
84
+ a.a-tag-topic:hover,
85
+ a.a-tag-topic:focus,
86
+ a.a-tag-topic:active {
87
87
  border-bottom: none;
88
88
  outline-offset: 1px;
89
89
 
@@ -94,11 +94,11 @@ a.a-tag-filter {
94
94
  }
95
95
  }
96
96
 
97
- .a-tag-topic:hover .a-tag-topic__text {
97
+ a.a-tag-topic:hover .a-tag-topic__text {
98
98
  border-bottom: 1px solid var(--gold-80);
99
99
  }
100
100
 
101
- .a-tag-topic:focus {
101
+ a.a-tag-topic:focus {
102
102
  outline-color: var(--gray);
103
103
 
104
104
  .a-tag-topic__text {
@@ -13,9 +13,5 @@
13
13
  //
14
14
  // Jump link
15
15
  //
16
-
17
- .a-link--jump {
18
- @include u-jump-link;
19
- }
20
-
21
- @include u-jump-link-group;
16
+ @include u-jump-link('a-link--jump', 'a-link__text');
17
+ @include u-jump-link-group('a-link--jump');
@@ -6,71 +6,92 @@
6
6
  // Jump link
7
7
  //
8
8
 
9
- @mixin u-jump-link($is-gold: false, $jump-link-text-class: 'a-link__text') {
10
- @if $is-gold {
11
- font-size: math.div(12px, $base-font-size-px) + rem;
12
- font-weight: 600;
13
- text-transform: uppercase;
14
- color: var(--gold-80);
15
- border-color: var(--gold-80);
16
- letter-spacing: 1px;
17
-
18
- @include u-link-colors(var(--gold-80));
19
-
20
- .#{$jump-link-text-class} {
21
- color: var(--gray);
22
- border-bottom-color: var(--gold-80);
23
- word-break: break-word;
9
+ @mixin u-jump-link(
10
+ $jump-link-class: 'a-link--jump',
11
+ $jump-link-text-class: 'a-link__text',
12
+ $is-gold: false
13
+ ) {
14
+ .#{$jump-link-class} {
15
+ @if $is-gold {
16
+ font-size: math.div(12px, $base-font-size-px) + rem;
17
+ font-weight: 600;
18
+ text-transform: uppercase;
19
+ color: var(--gold-80);
20
+ letter-spacing: 1px;
21
+
22
+ .#{$jump-link-class}__text {
23
+ color: var(--gray);
24
+ word-break: break-word;
25
+ }
26
+ } @else {
27
+ font-weight: 500;
24
28
  }
25
- } @else {
26
- font-weight: 500;
27
- }
28
29
 
29
- // Mobile only.
30
- @include respond-to-max($bp-xs-max) {
31
- position: relative;
32
- display: flex;
33
- align-items: center;
34
- gap: math.div(5px, $base-font-size-px) + rem;
35
-
36
- box-sizing: border-box;
37
- padding-top: math.div(10px, $base-font-size-px) + em;
38
- padding-bottom: math.div(10px, $base-font-size-px) + em;
39
- border-top-width: 1px;
40
- border-bottom-width: 1px;
41
-
42
- // 100% width is needed when block or jump link are applied to a <button>.
43
- width: 100%;
44
-
45
- // We create a faux focus rectangle in the ::after pseudoelement to better
46
- // control the positioning of the focus rectangle, which would overwise
47
- // overlap the top border of the jumplink when it appears in a group.
48
- &:focus {
49
- outline: none;
50
-
51
- &::after {
52
- position: absolute;
53
- content: '';
54
- display: block;
55
- position: absolute;
56
- width: 100%;
57
- height: 100%;
58
- outline: 1px dotted var(--gray);
59
- outline-offset: 2px;
30
+ // Mobile only.
31
+ @include respond-to-max($bp-xs-max) {
32
+ position: relative;
33
+ display: flex;
34
+ align-items: center;
35
+ gap: math.div(5px, $base-font-size-px) + rem;
36
+
37
+ box-sizing: border-box;
38
+ padding-top: math.div(10px, $base-font-size-px) + em;
39
+ padding-bottom: math.div(10px, $base-font-size-px) + em;
40
+
41
+ // 100% width is needed when block or jump link are applied to a <button>.
42
+ width: 100%;
43
+
44
+ // Only right-hand align arrow icons.
45
+ .cf-icon-svg--right {
46
+ margin-left: auto;
47
+ }
48
+
49
+ .#{$jump-link-text-class} {
50
+ border-bottom-width: 0;
51
+
52
+ // Arbitrary high value for flex-shrink to prevent squeezing of the icon
53
+ // when the link text is very long.
54
+ flex-shrink: 10;
60
55
  }
61
56
  }
57
+ }
62
58
 
63
- // Only right-hand align arrow icons.
64
- .cf-icon-svg--right {
65
- margin-left: auto;
59
+ // We need to separate out the jump link
60
+ a.#{$jump-link-class} {
61
+ @if $is-gold {
62
+ border-color: var(--gold-80);
63
+
64
+ @include u-link-colors(var(--gold-80));
65
+
66
+ .#{$jump-link-class}__text {
67
+ border-bottom-color: var(--gold-80);
68
+ }
69
+ } @else {
70
+ font-weight: 500;
66
71
  }
67
72
 
68
- .a-link__text {
69
- border-bottom-width: 0;
73
+ // Mobile only.
74
+ @include respond-to-max($bp-xs-max) {
75
+ border-top-width: 1px;
76
+ border-bottom-width: 1px;
70
77
 
71
- // Arbitrary high value for flex-shrink to prevent squeezing of the icon
72
- // when the link text is very long.
73
- flex-shrink: 10;
78
+ // We create a faux focus rectangle in the ::after pseudoelement to better
79
+ // control the positioning of the focus rectangle, which would overwise
80
+ // overlap the top border of the jumplink when it appears in a group.
81
+ &:focus {
82
+ outline: none;
83
+
84
+ &::after {
85
+ position: absolute;
86
+ content: '';
87
+ display: block;
88
+ position: absolute;
89
+ width: 100%;
90
+ height: 100%;
91
+ outline: 1px dotted var(--gray);
92
+ outline-offset: 2px;
93
+ }
94
+ }
74
95
  }
75
96
  }
76
97
  }
@@ -85,8 +106,8 @@
85
106
  border-top: none;
86
107
  }
87
108
 
88
- .#{$jump-link-class}:hover::before,
89
- .#{$jump-link-class}:focus::before {
109
+ a.#{$jump-link-class}:hover::before,
110
+ a.#{$jump-link-class}:focus::before {
90
111
  position: absolute;
91
112
  top: -1px;
92
113
  content: '';