Skip to content

Commit bb105d0

Browse files
committed
Refactor button to btn (for acf)
1 parent b40a740 commit bb105d0

File tree

11 files changed

+44
-43
lines changed

11 files changed

+44
-43
lines changed

index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ class="has-black-background-color has-background-dim-100 wp-block-cover__gradien
223223
</select>
224224
</div>
225225
<div>
226-
<button class="button-block">Button submit</button>
226+
<button class="btn-block">Button submit</button>
227+
<button class="btn-outline">Button submit outline</button>
227228
<input type="submit" value="Input submit">
228229
<input type="reset" value="Input reset">
229230
</div>

src/scss/02-tools/_m-button.scss renamed to src/scss/02-tools/_m-btn.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Button
33
*/
44

5-
@mixin button {
5+
@mixin btn {
66
display: inline;
77
padding: 0;
88
font-family: inherit;
@@ -18,7 +18,7 @@
1818
// button block
1919
// ----
2020

21-
@mixin button-block {
21+
@mixin btn-block {
2222
position: relative;
2323
z-index: 1;
2424
display: inline-block;
@@ -33,20 +33,20 @@
3333
border-radius: 10px;
3434

3535
@include hover {
36-
@include button-block-hover;
36+
@include btn-block-hover;
3737
}
3838
}
3939

4040
// hover of the button block
4141

42-
@mixin button-block-hover {
42+
@mixin btn-block-hover {
4343
color: $color-primary;
4444
background-color: $color-dark;
4545
}
4646

4747
// Coloring
4848

49-
@mixin button-block-colored($background-color, $color) {
49+
@mixin btn-block-colored($background-color, $color) {
5050
color: $color;
5151
background-color: $background-color;
5252

@@ -58,16 +58,16 @@
5858

5959
// Outline style
6060

61-
@mixin button-block-outline {
61+
@mixin btn-block-outline {
6262
padding: 13px 23px;
6363
background-color: transparent;
6464
border: 2px solid currentColor; // Force button width VS Gutenberg CSS
6565

6666
@include hover {
67-
@include button-block-outline-hover;
67+
@include btn-block-outline-hover;
6868
}
6969
}
7070

71-
@mixin button-block-outline-hover {
71+
@mixin btn-block-outline-hover {
7272
background-color: transparent;
7373
}

src/scss/02-tools/tools.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@import "./m-align";
1616
@import "./m-autofill";
1717
@import "./m-breakpoint";
18-
@import "./m-button";
18+
@import "./m-btn";
1919
@import "./m-checkbox-custom";
2020
@import "./m-clearflex";
2121
@import "./m-container";

src/scss/03-base/_forms.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ $all-text-inputs: assign-inputs($text-inputs-list);
9494
}
9595

9696
input[type="submit"] {
97-
@extend %button-block;
97+
@extend %btn-block;
9898
}
9999

100100
input[type="reset"] {
101-
@extend %button-block-outline;
101+
@extend %btn-block-outline;
102102
}
103103
}

src/scss/05-components/_btn.scss

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
%btn {
2+
@include btn;
3+
}
4+
5+
%btn-block {
6+
@extend %btn;
7+
@include btn-block;
8+
}
9+
10+
%btn-block-outline {
11+
@extend %btn-block;
12+
@include btn-block-outline;
13+
}
14+
15+
.btn {
16+
@extend %btn;
17+
}
18+
19+
.btn-block {
20+
@extend %btn-block;
21+
}
22+
23+
.btn-outline {
24+
@extend %btn-block-outline;
25+
}

src/scss/05-components/_button.scss

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/scss/05-components/components.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
* Elements folder entry file
33
*/
44

5-
@import "./button";
5+
@import "./btn";
66
@import "./searchform";
77
@import "./skip-links";

src/scss/06-blocks/core/_buttons.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
// ----
1111
&-button {
1212
.wp-block-button__link {
13-
@extend %button-block;
13+
@extend %btn-block;
1414
}
1515

1616
&.is-style-outline .wp-block-button__link {
17-
@extend %button-block-outline;
17+
@extend %btn-block-outline;
1818
}
1919

2020
&.has-custom-font-size .wp-block-button__link {

src/scss/06-blocks/core/_file.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
$el: &;
33

44
#{$el}__button {
5-
@extend %button-block;
5+
@extend %btn-block;
66
}
77
}

src/scss/06-blocks/core/_search.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
}
77

88
&__button {
9-
@extend %button-block;
9+
@extend %btn-block;
1010
}
1111
}

0 commit comments

Comments
 (0)