UNPKG

2.4 kBSCSSView Raw
1//
2// Copyright 2020 Google Inc.
3//
4// Permission is hereby granted, free of charge, to any person obtaining a copy
5// of this software and associated documentation files (the "Software"), to deal
6// in the Software without restriction, including without limitation the rights
7// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8// copies of the Software, and to permit persons to whom the Software is
9// furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20// THE SOFTWARE.
21//
22
23@use '@material/feature-targeting/feature-targeting';
24@use './select-icon-theme';
25
26@mixin icon-core-styles($query: feature-targeting.all()) {
27 $feat-structure: feature-targeting.create-target($query, structure);
28
29 .mdc-select--with-leading-icon {
30 @include _icon($query: $query);
31 @include select-icon-theme.icon-horizontal-margins(
32 $left: select-icon-theme.$icon-horizontal-margin,
33 $right: select-icon-theme.$icon-horizontal-margin,
34 $query: $query
35 );
36 }
37
38 .mdc-select__icon:not([tabindex]),
39 .mdc-select__icon[tabindex='-1'] {
40 @include feature-targeting.targets($feat-structure) {
41 cursor: default;
42 pointer-events: none;
43 }
44 }
45}
46
47@mixin _icon($query: feature-targeting.all()) {
48 $feat-structure: feature-targeting.create-target($query, structure);
49 $feat-color: feature-targeting.create-target($query, color);
50
51 .mdc-select__icon {
52 @include feature-targeting.targets($feat-structure) {
53 display: inline-block;
54 box-sizing: border-box;
55 border: none;
56 text-decoration: none;
57 cursor: pointer;
58 user-select: none;
59 flex-shrink: 0;
60 align-self: center;
61 }
62
63 @include feature-targeting.targets($feat-color) {
64 background-color: transparent;
65 fill: currentColor;
66 }
67 }
68}