Use prettier for SCSS (#3895)
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / style / ui / button.scss
CommitLineData
b8eab696
AE
1button,
2input[type="button"],
3input[type="reset"],
4input[type="submit"],
ed8c9052 5.button,
8a52619a
TD
6a.button {
7 // a.button is required to override link formatting, such as drop-down buttons
954d51cf 8 background-color: $wcfButtonBackground;
7967ab19 9 border-radius: 2px;
95cc4d01 10 border-width: 0;
ed8c9052 11 color: $wcfButtonText;
b8eab696
AE
12 cursor: pointer;
13 display: inline-block;
bec1bb2e 14 font-weight: 400;
c9f0d8b3 15 margin: 0;
4d194569 16 padding: 8px 18px;
7540e2d5 17 text-decoration: none;
8a52619a 18
487db634
MW
19 // input elements do not inherit font family, size and line-height from body
20 font-family: $wcfFontFamily;
5908f54f
AE
21 @include wcfFontDefault;
22 @include wcfLineHeight;
8a52619a 23
a5956329
AE
24 // removes UA styling enforced by Safari on iOS
25 -webkit-appearance: none;
8a52619a 26
67b6b44e 27 @include userSelectNone;
8a52619a 28
b8eab696 29 .icon {
7035df9a 30 color: inherit;
b8eab696 31 }
8a52619a 32
aae38e97 33 &.active {
954d51cf 34 background-color: $wcfButtonBackgroundActive;
ed8c9052 35 color: $wcfButtonTextActive;
7540e2d5 36 text-decoration: none;
b8eab696 37 }
8a52619a 38
18fbae7c
MW
39 &:not(.inputPrefix) {
40 text-transform: uppercase;
41 }
8a52619a 42
b8eab696 43 &.small {
4d194569 44 padding: 6px 8px;
f13f4344 45 text-transform: none;
8a52619a 46
5908f54f 47 @include wcfFontSmall;
b8eab696 48 }
8a52619a 49
ccf4def3
MW
50 small {
51 color: inherit;
52 }
b8eab696
AE
53}
54
55button.buttonPrimary,
56input[type="button"].buttonPrimary,
57input[type="submit"],
ed8c9052 58.button.buttonPrimary,
8a52619a
TD
59a.button.buttonPrimary {
60 // a.button is required to override link formatting, such as dropdown buttons
f2b50825 61 background-color: $wcfButtonPrimaryBackground;
ed8c9052 62 color: $wcfButtonPrimaryText;
8a52619a 63
aae38e97 64 &.active {
f2b50825 65 background-color: $wcfButtonPrimaryBackgroundActive;
ed8c9052 66 color: $wcfButtonPrimaryTextActive;
f2b50825
AE
67 }
68}
69
aae38e97
MS
70/* hover states are only applied to non-touch devices to avoid "leftover" hover states after taps */
71html:not(.touch) {
72 button,
73 input[type="button"],
74 input[type="reset"],
75 input[type="submit"],
76 .button,
77 a.button {
78 &:hover {
79 background-color: $wcfButtonBackgroundActive;
80 color: $wcfButtonTextActive;
81 text-decoration: none;
82 }
83 }
8a52619a 84
aae38e97
MS
85 button.buttonPrimary,
86 input[type="button"].buttonPrimary,
87 input[type="submit"],
88 .button.buttonPrimary,
8a52619a
TD
89 a.button.buttonPrimary {
90 // a.button is required to override link formatting, such as dropdown buttons
aae38e97
MS
91 &:hover {
92 background-color: $wcfButtonPrimaryBackgroundActive;
93 color: $wcfButtonPrimaryTextActive;
94 }
95 }
96}
97
63d349a3
AE
98/* disabled state */
99button,
100input[type="button"],
101input[type="reset"],
102input[type="submit"],
103.button,
104a.button {
105 &:disabled,
106 &.disabled {
107 background-color: $wcfButtonDisabledBackground !important;
63d349a3
AE
108 color: $wcfButtonDisabledText !important;
109 cursor: not-allowed !important;
b3fa7916 110 pointer-events: none;
63d349a3
AE
111 }
112}
113
f2b50825
AE
114/* force active state for buttons toggling a dropdown */
115.dropdownOpen {
116 > button,
117 > input[type="button"],
118 > input[type="reset"],
119 > input[type="submit"],
ed8c9052
AE
120 > .button,
121 > a.button {
f2b50825 122 background-color: $wcfButtonBackgroundActive;
ed8c9052 123 color: $wcfButtonTextActive;
f2b50825 124 }
8a52619a 125
f2b50825
AE
126 > button.buttonPrimary,
127 > input[type="button"].buttonPrimary,
128 > input[type="submit"],
ed8c9052
AE
129 > .button.buttonPrimary,
130 > a.button.buttonPrimary {
f2b50825 131 background-color: $wcfButtonPrimaryBackgroundActive;
ed8c9052 132 color: $wcfButtonPrimaryTextActive;
b8eab696 133 }
b8eab696
AE
134}
135
136.buttonList {
5908f54f 137 @include inlineList;
8a52619a 138
b8eab696 139 &.smallButtons .button {
4d194569 140 padding: 6px 8px;
f13f4344 141 text-transform: none;
8a52619a 142
5908f54f 143 @include wcfFontSmall;
b8eab696 144 }
8a52619a 145
b8eab696
AE
146 /* members list */
147 &.letters {
148 margin-bottom: -10px;
8a52619a 149
b8eab696 150 > li {
efea49bc 151 flex: 0 0 auto;
b8eab696 152 margin-bottom: 10px;
e2fa3bc1 153 width: 10%;
8a52619a 154
e2fa3bc1
MW
155 &.lettersReset {
156 width: auto;
157 }
8a52619a 158
b8eab696
AE
159 > a {
160 display: block;
e01ff1d8
MW
161 min-width: -moz-min-content;
162 min-width: -webkit-min-content;
20f920dc 163 min-width: min-content;
b8eab696
AE
164 text-align: center;
165 }
166 }
167 }
168}
169
170.buttonGroupNavigation > ul {
5908f54f 171 @include inlineList;
b8eab696
AE
172}
173
174.buttonGroup {
6a4be890 175 margin-bottom: -1px;
8a52619a 176
5908f54f 177 @include inlineList;
8a52619a 178
b8eab696 179 > li {
6a4be890 180 margin-bottom: 1px;
8a52619a 181
b8eab696 182 &:not(:last-child) {
b1676884 183 margin-right: 1px;
b8eab696 184 }
8a52619a 185
b8eab696 186 &:first-child .button {
7967ab19
AE
187 border-top-left-radius: 2px;
188 border-bottom-left-radius: 2px;
b8eab696 189 }
8a52619a 190
b8eab696 191 &:last-child .button {
7967ab19
AE
192 border-top-right-radius: 2px;
193 border-bottom-right-radius: 2px;
b8eab696 194 }
8a52619a 195
b8eab696
AE
196 .button {
197 border-radius: 0;
f2b50825 198 border-width: 0;
b8eab696
AE
199 }
200 }
201}