Skip to content

Commit 499b1da

Browse files
Migrate custom BEM to getBEM syntax
1 parent 70c6454 commit 499b1da

File tree

38 files changed

+335
-335
lines changed

38 files changed

+335
-335
lines changed

docs/assets/css/color-swatches.less

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
.swatch {
1313
margin-left: 0;
1414

15-
&_field {
15+
&__field {
1616
height: 5em;
1717
}
1818

19-
&__primary &_field {
19+
&--primary &__field {
2020
height: 10em;
2121
}
2222

23-
&_head {
23+
&__head {
2424
margin: 0.25em 0;
2525
}
2626

27-
&_table {
27+
&__table {
2828
width: 100%;
2929
}
3030

@@ -40,7 +40,7 @@
4040
text-align: left;
4141
}
4242

43-
&_field__green {
43+
&__field__green {
4444
background: @green;
4545
}
4646
}

docs/assets/css/footer.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
.ds-footer {
66
padding-bottom: 30px;
77

8-
&_content {
8+
&__content {
99
max-width: 41.875rem;
1010
}
1111

docs/assets/css/skip-nav.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
.skip-nav {
1313
position: relative;
1414

15-
&_link {
15+
&__link {
1616
position: absolute;
1717
top: auto;
1818
left: -10000px;
@@ -42,7 +42,7 @@
4242
background 0.2s linear;
4343
}
4444

45-
&__flush-left:focus {
45+
&--flush-left:focus {
4646
left: 0;
4747
}
4848
}

docs/assets/css/tabs.less

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// All screen sizes.
22
.m-tabs {
3-
&_list {
3+
&__list {
44
border-top: 1px solid @gray;
55
margin: 0;
66
padding: 0;
77
list-style: none;
88
display: none;
99
}
1010

11-
&_list-item {
11+
&__list-item {
1212
.heading-5();
1313
border-bottom: 0;
1414
margin-bottom: 0;
@@ -31,7 +31,7 @@
3131
}
3232
}
3333

34-
&_tab {
34+
&__tab {
3535
border: 0;
3636
color: @gray;
3737
display: block;
@@ -64,7 +64,7 @@
6464
}
6565
}
6666

67-
&_panel {
67+
&__panel {
6868
background-color: @gray-5;
6969
margin-bottom: 30px;
7070
}

docs/assets/css/variation.less

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
border: 5px solid @gray-10;
77
margin: 2rem 0;
88

9-
&_title {
9+
&__title {
1010
background: @gray-10;
1111
margin-bottom: 2rem;
1212
padding: 1rem;
1313
}
1414

15-
&_description {
15+
&__description {
1616
margin-bottom: 2rem;
1717
}
1818

19-
&_description,
19+
&__description,
2020
& .m-variation {
2121
padding-left: 1rem;
2222
padding-right: 1rem;
@@ -26,11 +26,11 @@
2626
.m-variation {
2727
border-bottom: 1px solid @gray-40;
2828

29-
&_name {
29+
&__name {
3030
margin-top: 2rem;
3131
}
3232

33-
&_deprecated {
33+
&__deprecated {
3434
background: @gray-10;
3535
font-size: unit((10px / @base-font-size-px), em);
3636
font-variant: small-caps;

packages/cfpb-buttons/src/atoms/button-links.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// TODO: Refactor the rule combos for simplicity
66

7-
.a-btn__link {
7+
.a-btn--link {
88
padding: 0;
99
// Padding added so the focus rectangle falls below the underline.
1010
padding-bottom: 1.5px;
@@ -49,7 +49,7 @@
4949
// Secondary button link
5050
//
5151

52-
&.a-btn__secondary {
52+
&.a-btn--secondary {
5353
&,
5454
&:link,
5555
&:visited {
@@ -80,7 +80,7 @@
8080
// Destructive action button link
8181
//
8282

83-
&.a-btn__warning {
83+
&.a-btn--warning {
8484
&,
8585
&:link,
8686
&:visited {

packages/cfpb-buttons/src/atoms/buttons-with-icons.less

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22
// TODO: Replace magic numbers with calculations based off of the
33
// button padding size
44

5-
.a-btn_icon__on-left {
5+
.a-btn__icon--on-left {
66
padding-right: unit((11px / @btn-font-size), em);
77
border-right: 1px solid mix(@btn-bg, @btn-text, 50%);
88
margin-right: unit((7px / @btn-font-size), em);
99
}
1010

11-
.a-btn_icon__on-right {
11+
.a-btn__icon--on-right {
1212
padding-left: unit((11px / @btn-font-size), em);
1313
border-left: 1px solid mix(@btn-bg, @btn-text, 50%);
1414
margin-left: unit((7px / @btn-font-size), em);
1515
}
1616

17-
.a-btn_icon {
18-
.a-btn__secondary & {
17+
.a-btn__icon {
18+
.a-btn--secondary & {
1919
border-color: mix(@btn__secondary-bg, @btn__secondary-text, 50%);
2020
}
2121

22-
.a-btn__warning & {
22+
.a-btn--warning & {
2323
border-color: mix(@btn__warning-bg, @btn__warning-text, 50%);
2424
}
2525

26-
.a-btn__disabled &,
26+
.a-btn--disabled &,
2727
.a-btn[disabled] & {
2828
border-color: mix(@btn__disabled-bg, @btn__disabled-text, 50%);
2929
}

packages/cfpb-buttons/src/atoms/buttons.less

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
// Secondary button
5858
//
5959

60-
&__secondary {
60+
&--secondary {
6161
&,
6262
&:link,
6363
&:visited {
@@ -87,7 +87,7 @@
8787
// Destructive action button
8888
//
8989

90-
&__warning {
90+
&--warning {
9191
&,
9292
&:link,
9393
&:visited {
@@ -117,7 +117,7 @@
117117
// Disabled button
118118
//
119119

120-
&__disabled,
120+
&--disabled,
121121
&[disabled] {
122122
&,
123123
&:link,
@@ -143,7 +143,7 @@
143143
//
144144
// Full width button on x-small screens
145145
//
146-
&__full-on-xs {
146+
&--full-on-xs {
147147
// Mobile only.
148148
.respond-to-max(@bp-xs-max, {
149149
display: block;

packages/cfpb-core/src/utilities.less

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@
150150
.u-flexible-container {
151151
.u-flexible-container-mixin();
152152

153-
&_inner {
153+
&__inner {
154154
position: absolute;
155155
top: 0;
156156
left: 0;
157157
width: 100%;
158158
height: 100%;
159159
}
160160

161-
&__4-3 {
161+
&--4-3 {
162162
.u-flexible-container-mixin( 4, 3 );
163163
}
164164
}
@@ -167,39 +167,39 @@
167167
// Link mixins
168168
//
169169

170-
.u-link__colors() {
171-
.u-link__colors-base();
170+
.u-link--colors() {
171+
.u-link--colors-base();
172172
}
173173

174-
.u-link__colors( @c ) {
175-
.u-link__colors-base(
174+
.u-link--colors( @c ) {
175+
.u-link--colors-base(
176176
@c, @c, @c, @c, @c,
177177
@c, @c, @c, @c, @c
178178
);
179179
}
180180

181-
.u-link__colors( @c, @h ) {
182-
.u-link__colors-base(
181+
.u-link--colors( @c, @h ) {
182+
.u-link--colors-base(
183183
@c, @c, @h, @h, @c,
184184
@c, @c, @h, @h, @c
185185
);
186186
}
187187

188-
.u-link__colors( @c, @v, @h, @f, @a ) {
189-
.u-link__colors-base(
188+
.u-link--colors( @c, @v, @h, @f, @a ) {
189+
.u-link--colors-base(
190190
@c, @v, @h, @f, @a,
191191
@c, @v, @h, @f, @a
192192
);
193193
}
194194

195-
.u-link__colors( @c, @v, @h, @f, @a, @bc, @bv, @bh, @bf, @ba ) {
196-
.u-link__colors-base(
195+
.u-link--colors( @c, @v, @h, @f, @a, @bc, @bv, @bh, @bf, @ba ) {
196+
.u-link--colors-base(
197197
@c, @v, @h, @f, @a,
198198
@bc, @bv, @bh, @bf, @ba
199199
);
200200
}
201201

202-
.u-link__colors-base(
202+
.u-link--colors-base(
203203
@c: @link-text,
204204
@v: @link-text-visited,
205205
@h: @link-text-hover,
@@ -238,15 +238,15 @@
238238
}
239239
}
240240

241-
.u-link__border() {
241+
.u-link--border() {
242242
border-bottom-width: 1px;
243243
}
244244

245-
.u-link__no-border() {
245+
.u-link--no-border() {
246246
border-bottom-width: 0 !important;
247247
}
248248

249-
.u-link__hover-border() {
249+
.u-link--hover-border() {
250250
border-bottom-width: 0 !important;
251251

252252
&:hover,

0 commit comments

Comments
 (0)