| 1 |
/* |
| 2 |
* Includes icon and alternate color mixin functions. |
| 3 |
*/ |
| 4 |
|
| 5 |
/* helpers */ |
| 6 |
// to calculate when the value is an even number or not |
| 7 |
isEven($value) { |
| 8 |
if ($value % 2 == 0) { |
| 9 |
true; |
| 10 |
} else { |
| 11 |
false; |
| 12 |
} |
| 13 |
} |
| 14 |
|
| 15 |
// to take half of the given value |
| 16 |
half($value) { |
| 17 |
$value / 2; |
| 18 |
} |
| 19 |
|
| 20 |
/* icons */ |
| 21 |
// line-height and font-size can be overridden after calling _icon-core-style() |
| 22 |
_icon-core-style() { |
| 23 |
font-family: $icon-font-family; |
| 24 |
speak: none; |
| 25 |
font-style: normal; |
| 26 |
font-weight: normal; |
| 27 |
font-variant: normal; |
| 28 |
text-transform: none; |
| 29 |
line-height: 1; |
| 30 |
font-size: $icon-size; |
| 31 |
-webkit-font-smoothing: antialiased; |
| 32 |
-moz-osx-font-smoothing: grayscale; |
| 33 |
} |
| 34 |
|
| 35 |
/* Button */ |
| 36 |
_button-hover(color) { |
| 37 |
background: darken(color, 5%); |
| 38 |
border-color: darken(color, 15%); |
| 39 |
} |
| 40 |
|
| 41 |
_button-active(color) { |
| 42 |
background: darken(color, 12%); |
| 43 |
border-color: darken(color, 30%); |
| 44 |
} |
| 45 |
|
| 46 |
_button-disabled(color) { |
| 47 |
background: lighten(color, 35%); |
| 48 |
border-color: lighten(color, 22%) |
| 49 |
color: darken($button-alternative-text-color, 5%); |
| 50 |
} |
| 51 |
|
| 52 |
// common button style properties |
| 53 |
button-style() { |
| 54 |
border-style: solid; |
| 55 |
border-width: 1px; |
| 56 |
border-color: $border-color; |
| 57 |
padding: $padding; |
| 58 |
border-radius: $border-radius; |
| 59 |
line-height: $line-height; |
| 60 |
cursor: pointer; |
| 61 |
transition: all 0.05s linear; |
| 62 |
background: $theme-base-color; |
| 63 |
} |
| 64 |
|
| 65 |
button-hover-style() { |
| 66 |
transition: all 0.1s; |
| 67 |
_button-hover($theme-base-color); |
| 68 |
} |
| 69 |
|
| 70 |
button-active-style() { |
| 71 |
transition: none; |
| 72 |
outline: none; |
| 73 |
box-shadow: $shadow-inset; |
| 74 |
_button-active($theme-base-color); |
| 75 |
} |
| 76 |
|
| 77 |
button-disabled-style() { |
| 78 |
cursor: default; |
| 79 |
color: $button-disabled-color; |
| 80 |
background-color: $button-disabled-background-color; |
| 81 |
border-color: $button-disabled-border-color; |
| 82 |
} |
| 83 |
|
| 84 |
// alternative colors |
| 85 |
create-alternative-buttons(colors) { |
| 86 |
colors = arguments if length(arguments) >= 1; |
| 87 |
for class in colors { |
| 88 |
.dijitButton.{class} .dijitButtonNode, |
| 89 |
.dijitDropDownButton.{class} .dijitButtonNode, |
| 90 |
.dijitComboButton.{class} .dijitButtonNode, |
| 91 |
.dijitToggleButton.{class} .dijitButtonNode, |
| 92 |
.dijitComboBox.{class} .dijitButtonNode, |
| 93 |
.dijitSelect.{class} .dijitButtonContents, |
| 94 |
.dijitSelect.{class} .dijitButtonNode, |
| 95 |
.dijitSpinner.{class} .dijitArrowButton { |
| 96 |
background: colors[class]; |
| 97 |
color: $button-alternative-text-color; |
| 98 |
border-color: darken(colors[class], 18.5%); |
| 99 |
} |
| 100 |
// combo button border |
| 101 |
.dijitComboButton.{class} .dijitStretch { |
| 102 |
border-right-color: darken(colors[class], 18.5%); |
| 103 |
} |
| 104 |
.dijitComboButtonRtl.{class} .dijitStretch { |
| 105 |
border-left-color: darken(colors[class], 18.5%);; |
| 106 |
} |
| 107 |
} |
| 108 |
} |
| 109 |
|
| 110 |
create-alternative-buttons-hover(colors) { |
| 111 |
colors = arguments if length(arguments) >= 1; |
| 112 |
for class in colors { |
| 113 |
.dijitButtonHover.{class} .dijitButtonNode, |
| 114 |
.dijitDropDownButtonHover.{class} .dijitButtonNode, |
| 115 |
.dijitComboButton.{class} .dijitButtonNodeHover, |
| 116 |
.dijitComboButton.{class} .dijitDownArrowButtonHover, |
| 117 |
.dijitToggleButtonHover.{class} .dijitButtonNode, |
| 118 |
.dijitComboBoxHover.{class} .dijitButtonNode, |
| 119 |
.dijitSelectHover.{class} .dijitButtonContents, |
| 120 |
.dijitSelectHover.{class} .dijitButtonNode, |
| 121 |
.dijitSelect.dijitSelectOpened.{class} .dijitButtonContents, |
| 122 |
.dijitSelect.dijitSelectOpened.{class} .dijitArrowButton, |
| 123 |
.dijitSpinner.{class} .dijitUpArrowButtonHover, |
| 124 |
.dijitSpinner.{class} .dijitDownArrowButtonHover { |
| 125 |
_button-hover(colors[class]); |
| 126 |
} |
| 127 |
} |
| 128 |
} |
| 129 |
|
| 130 |
create-alternative-buttons-active(colors) { |
| 131 |
colors = arguments if length(arguments) >= 1; |
| 132 |
for class in colors { |
| 133 |
.dijitButtonActive.{class} .dijitButtonNode, |
| 134 |
.dijitDropDownButtonActive.{class} .dijitButtonNode, |
| 135 |
.dijitComboButton.{class} .dijitButtonNodeActive, |
| 136 |
.dijitToggleButtonActive.{class} .dijitButtonNode, |
| 137 |
.dijitComboBoxActive.{class} .dijitButtonNode, |
| 138 |
.dijitSelectActive.{class} .dijitButtonContents, .dijitSelectActive.{class} .dijitArrowButton, |
| 139 |
.dijitSelect.dijitSelectOpened.{class} .dijitButtonContents, .dijitSelect.dijitSelectOpened.{class} .dijitArrowButton , |
| 140 |
.dijitComboBox.{class} .dijitButtonNode.dijitHasDropDownOpen, |
| 141 |
.dijitSpinner.{class} .dijitUpArrowButtonActive, .dijitSpinner.{class} .dijitDownArrowButtonActive { |
| 142 |
_button-active(colors[class]); |
| 143 |
} |
| 144 |
} |
| 145 |
} |
| 146 |
|
| 147 |
create-alternative-buttons-disabled(colors) { |
| 148 |
colors = arguments if length(arguments) >= 1; |
| 149 |
for class in colors { |
| 150 |
.dijitButtonDisabled.{class}, |
| 151 |
.dijitDropDownButtonDisabled.{class}, |
| 152 |
.dijitComboButtonDisabled.{class}, |
| 153 |
.dijitToggleButtonDisabled.{class} { |
| 154 |
.dijitButtonNode { |
| 155 |
_button-disabled(colors[class]); |
| 156 |
} |
| 157 |
} |
| 158 |
// combo button border |
| 159 |
.dijitComboButtonDisabled.{class} .dijitStretch { |
| 160 |
border-right-color: lighten(colors[class], 22%); |
| 161 |
} |
| 162 |
.dijitComboButtonRtlDisabled.{class} .dijitStretch { |
| 163 |
border-left-color: lighten(colors[class], 22%); |
| 164 |
} |
| 165 |
// combo box |
| 166 |
.dijitComboBoxDisabled.{class} .dijitButtonNode { |
| 167 |
border-left-color: lighten(colors[class], 22%); |
| 168 |
} |
| 169 |
.dijitComboBoxRtlDisabled.{class} .dijitButtonNode { |
| 170 |
border-right-color: lighten(colors[class], 22%); |
| 171 |
} |
| 172 |
// time textbox |
| 173 |
.dijitTimeTextBoxDisabled.{class} .dijitButtonNode { |
| 174 |
border-left-color: lighten(colors[class], 22%); |
| 175 |
} |
| 176 |
.dijitTimeTextBoxRtlDisabled.{class} .dijitButtonNode { |
| 177 |
border-right-color: lighten(colors[class], 22%); |
| 178 |
} |
| 179 |
// date textbox |
| 180 |
.dijitDateTextBoxDisabled.{class} .dijitButtonNode { |
| 181 |
border-left-color: lighten(colors[class], 22%); |
| 182 |
} |
| 183 |
.dijitDateTextBoxRtlDisabled.{class} .dijitButtonNode { |
| 184 |
border-right-color: lighten(colors[class], 22%); |
| 185 |
} |
| 186 |
} |
| 187 |
} |
| 188 |
|
| 189 |
/* TextBox */ |
| 190 |
// alternative colors (Textboxes in Select, ComboBox, NumberSpinner, TimeTextBox and DateTextBox) |
| 191 |
create-alternative-textboxes(colors) { |
| 192 |
colors = arguments if length(arguments) >= 1; |
| 193 |
for class in colors { |
| 194 |
.dijitSelect.{class}, |
| 195 |
.dijitComboBox.{class}, |
| 196 |
.dijitSpinner.{class} { |
| 197 |
border-color: colors[class]; |
| 198 |
} |
| 199 |
} |
| 200 |
} |
| 201 |
|
| 202 |
create-alternative-textboxes-disabled(colors) { |
| 203 |
colors = arguments if length(arguments) >= 1; |
| 204 |
for class in colors { |
| 205 |
.dijitComboBoxDisabled.{class}, |
| 206 |
.dijitSpinnerDisabled.{class} { |
| 207 |
background: $disabled-background-color; |
| 208 |
color: $disabled-color; |
| 209 |
border: lighten(colors[class], 35%); |
| 210 |
} |
| 211 |
.dijitComboBoxDisabled.{class} .dijitButtonNode, |
| 212 |
.dijitSpinnerDisabled.{class} .dijitButtonNode { |
| 213 |
background: lighten(colors[class], 35%); |
| 214 |
color: darken($button-alternative-text-color, 5%); |
| 215 |
} |
| 216 |
// number spinner border |
| 217 |
.dijitSpinnerDisabled.{class} .dijitSpinnerButtonContainer { |
| 218 |
border-left-color: lighten(colors[class], 35%); |
| 219 |
} |
| 220 |
.dijitSpinnerRtlDisabled.{class} .dijitSpinnerButtonContainer { |
| 221 |
border-right-color: lighten(colors[class], 35%);; |
| 222 |
} |
| 223 |
// select |
| 224 |
.dijitSelectDisabled.{class} { |
| 225 |
border-color: lighten(colors[class], 35%); |
| 226 |
} |
| 227 |
.dijitSelectDisabled.{class} .dijitStretch, |
| 228 |
.dijitSelectDisabled.{class} .dijitButtonNode { |
| 229 |
background: lighten(colors[class], 35%); |
| 230 |
color: darken($button-alternative-text-color, 5%); |
| 231 |
} |
| 232 |
} |
| 233 |
} |
| 234 |
|
| 235 |
/* ProgressBar alternate colors */ |
| 236 |
_progress-bar-color-properties(color) { |
| 237 |
background-color: color; |
| 238 |
} |