Skip to content

Commit 6d9dee8

Browse files
authored
Merge pull request #799 from lalithkarikelli/surf2105
docs(dropdown): implement and document attrs and vars
2 parents 81fcc34 + 07f9bed commit 6d9dee8

File tree

2 files changed

+25
-36
lines changed

2 files changed

+25
-36
lines changed

src/scss/components/dropdown-select/mixins/SelectControl.scss

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
color: transparent;
99
text-shadow: 0 0 0 $gray-900;
1010
}
11-
}
12-
@else {
13-
background-color: $gray-0;
14-
color: $gray-900;
11+
} @else {
12+
background-color: var(--hxDropdown-hxSelect-unfocused-backgroundColor, $gray-0);
13+
color: var(--hxDropdown-hxSelect-unfocused-color, $gray-900);
1514
}
1615
}
1716

@@ -23,10 +22,9 @@
2322
color: transparent;
2423
text-shadow: 0 0 0 $gray-900;
2524
}
26-
}
27-
@else {
28-
background-color: $gray-0;
29-
color: $gray-900;
25+
} @else {
26+
background-color: var(--hxDropdown-hxSelect-unfocused-invalid-backgroundColor, $gray-0);
27+
color: var(--hxDropdown-hxSelect-unfocused-invalid-color, $gray-900);
3028
}
3129
}
3230

@@ -38,10 +36,9 @@
3836
color: transparent;
3937
text-shadow: 0 0 0 $gray-900;
4038
}
41-
}
42-
@else {
43-
background-color: $gray-100;
44-
color: $gray-700;
39+
} @else {
40+
background-color: var(--hxDropdown-hxSelect-unfocused-disabled-backgroundColor, $gray-100);
41+
color: var(--hxDropdown-hxSelect-unfocused-disabled-color, $gray-700);
4542
opacity: 1;
4643
}
4744
}
@@ -56,11 +53,9 @@
5653
@mixin hxSelectControl($state: null, $focused: false) {
5754
@if $state == invalid {
5855
@include __selectControl--invalid($focused);
59-
}
60-
@else if $state == disabled {
56+
} @else if $state == disabled {
6157
@include __selectControl--disabled($focused);
62-
}
63-
@else {
58+
} @else {
6459
@include __selectControl($focused);
6560
}
6661
}

src/scss/components/dropdown-select/mixins/SelectFacade.scss

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,36 @@
22

33
@mixin __selectFacade($focused: false) {
44
@if $focused {
5-
border: 1px solid $cyan-700;
5+
border: 1px solid var(--hxDropdown-hxSelect-focused-borderColor, $blue-700);
66
box-shadow: $focus-glow;
7-
}
8-
@else {
9-
border: 1px solid $gray-500;
10-
color: $gray-900;
7+
} @else {
8+
border: 1px solid var(--hxDropdown-hxSelect-unfocused-borderColor, $gray-500);
9+
color: var(--hxDropdown-hxSelect-color, $gray-900);
1110
}
1211
}
1312

1413
@mixin __selectFacade--invalid($focused: false) {
1514
@if $focused {
16-
border: 2px solid $red-900;
15+
border: 2px solid var(--hxDropdown-hxSelect-invalid-focused-borderColor, $red-status-900);
1716
box-shadow: $focus-glow-invalid;
18-
}
19-
@else {
20-
border: 2px solid $red-900;
21-
color: $gray-900;
17+
} @else {
18+
border: 2px solid var(--hxDropdown-hxSelect-invalid-unfocused-borderColor, $red-status-900);
19+
color: var(--hxDropdown-hxSelect-invalid-color, $gray-900);
2220
}
2321
}
2422

2523
@mixin __selectFacade--disabled($focused: false) {
2624
@if $focused {
27-
border: 1px solid $gray-500;
25+
border: 1px solid var(--hxDropdown-hxSelect-disabled-focused-borderColor, $gray-500);
2826
box-shadow: $focus-glow;
29-
}
30-
@else {
27+
} @else {
3128
--hxTrigger-backgroundColor: #{$gray-100};
3229

33-
border: 1px solid $gray-500;
34-
color: $gray-700;
30+
border: 1px solid var(--hxDropdown-hxSelect-disabled-unfocused-borderColor, $gray-500);
31+
color: var(--hxDropdown-hxSelect-disabled-color, $gray-700);
3532
}
3633
}
3734

38-
3935
// LESS SCSS
4036
// .SelectFacade(pristine) -> hxSelectFacade;
4137
// .SelectFacade(pristine-focus) -> hxSelectFacade($focused: true);
@@ -46,11 +42,9 @@
4642
@mixin hxSelectFacade($state: null, $focused: false) {
4743
@if $state == invalid {
4844
@include __selectFacade--invalid($focused);
49-
}
50-
@else if $state == disabled {
45+
} @else if $state == disabled {
5146
@include __selectFacade--disabled($focused);
52-
}
53-
@else {
47+
} @else {
5448
@include __selectFacade($focused);
5549
}
5650
}

0 commit comments

Comments
 (0)