Skip to content

Commit 3f0ceaa

Browse files
authored
feat(button): dedicated variables for toggle and circular
This PR uses dedicated variables for toggle button and circular button variants to allow for consistent theming. Circular button had hardcoded values and toggle had fixed global variable names set, which made it nearly impossible to theme individually.
1 parent 5c37067 commit 3f0ceaa

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

src/definitions/elements/button.less

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,16 +1043,16 @@
10431043
.ui.toggle.buttons .active.button,
10441044
.ui.buttons .button.toggle.active,
10451045
.ui.button.toggle.active {
1046-
background-color: @positiveColor;
1046+
background-color: @toggleBackgroundColor;
10471047
box-shadow: none;
1048-
text-shadow: @invertedTextShadow;
1049-
color: @invertedTextColor;
1048+
text-shadow: @toggleTextShadow;
1049+
color: @toggleColor;
10501050
}
10511051

10521052
.ui.button.toggle.active:hover {
1053-
background-color: @positiveColorHover;
1054-
text-shadow: @invertedTextShadow;
1055-
color: @invertedTextColor;
1053+
background-color: @toggleHoverBackgroundColor;
1054+
text-shadow: @toggleHoverTextShadow;
1055+
color: @toggleHoverColor;
10561056
}
10571057
}
10581058

@@ -1062,11 +1062,11 @@
10621062
---------------*/
10631063

10641064
.ui.circular.button {
1065-
border-radius: 10em;
1065+
border-radius: @circularBorderRadius;
10661066
}
10671067

10681068
.ui.circular.button > .icon {
1069-
width: 1em;
1069+
width: @circularIconWidth;
10701070
vertical-align: baseline;
10711071
}
10721072
}

src/themes/default/elements/button.variables

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,3 +390,15 @@
390390
@animationEasing: ease;
391391
@fadeScaleHigh: 1.5;
392392
@fadeScaleLow: 0.75;
393+
394+
/* Toggle */
395+
@toggleColor: @invertedTextColor;
396+
@toggleBackgroundColor: @positiveColor;
397+
@toggleTextShadow: @invertedTextShadow;
398+
@toggleHoverColor: @invertedTextColor;
399+
@toggleHoverBackgroundColor: @positiveColorHover;
400+
@toggleHoverTextShadow: @invertedTextShadow;
401+
402+
/* Circular */
403+
@circularBorderRadius: 10em;
404+
@circularIconWidth: 1em;

0 commit comments

Comments
 (0)