Skip to content

Commit 910bd7f

Browse files
authored
Merge pull request #587 from HelixDesignSystem/surf-1897-deprecate-button-less-mixins
refactor(SCSS): refactor Button mixins to support Shadow DOM use
2 parents a8a8c95 + 554f6d2 commit 910bd7f

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

src/elements/hx-file-tile/_shadow.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
// TODO: add hooks for overriding retry button colors?
2020
#hxRetry {
21-
@include button-basic;
21+
@include button-common;
2222
@include button-small;
2323
@include button-tertiary;
2424

src/less/components/button/index.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/* ================================================== *\
2-
* MIXINS
3-
\* ================================================== */
1+
// ================================================== //
2+
// MIXINS - DEPRECATED! Use SCSS instead! //
3+
// ================================================== //
44
#Button {
55
.reset() {
66
background-color: transparent;

src/scss/components/button/_mixins.scss

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import "vars";
22

3-
@mixin button-reset {
3+
@mixin button-reset { // less: #Button.reset()
44
background-color: transparent;
55
border: 0;
66
color: inherit;
@@ -13,10 +13,14 @@
1313
padding: 0;
1414
}
1515

16-
@mixin button-basic {
16+
@mixin button-base {
1717
border-radius: 2px;
1818
display: inline-flex;
1919
justify-content: center;
20+
}
21+
22+
@mixin button-common { // less: #Button.basic()
23+
@include button-base;
2024

2125
> * + * {
2226
margin-left: 0.5rem;
@@ -35,7 +39,9 @@
3539
}
3640
}
3741

38-
@mixin button-primary {
42+
/// ---------- BUTTON WEIGHTS ----------
43+
44+
@mixin button-primary { // less: #Button.primary()
3945
background-color: $cyan-900;
4046
color: $gray-0;
4147

@@ -63,7 +69,7 @@
6369
}
6470
}
6571

66-
@mixin button-secondary {
72+
@mixin button-secondary { // less: #Button.secondary()
6773
border: 1px solid $cyan-900;
6874
color: $cyan-900;
6975

@@ -90,9 +96,9 @@
9096
}
9197
}
9298

93-
@mixin button-tertiary {
99+
@mixin button-tertiary { // less: #Button.tertiary()
94100
background-color: transparent;
95-
border: none;
101+
border: 0;
96102
color: $cyan-900;
97103
padding-left: 0;
98104
padding-right: 0;
@@ -120,16 +126,18 @@
120126
}
121127
}
122128

123-
@mixin button-small {
129+
/// ---------- BUTTON SIZES ----------
130+
131+
@mixin button-small { // less: #Button.small()
124132
padding: 0.125rem 0.5rem; // 2px 8px
125133
}
126134

127-
@mixin button-medium {
135+
@mixin button-medium { // less: #Button.medium()
128136
font-size: 0.875rem;
129-
padding: 8px 12px;
137+
padding: 0.5rem 0.75rem; // 8px 12px;
130138
}
131139

132-
@mixin button-large {
140+
@mixin button-large { // less: #Button.large()
133141
font-size: 1rem;
134142
padding: 1rem;
135143
}

0 commit comments

Comments
 (0)