UNPKG

2.62 kBSCSSView Raw
1//
2// Copyright 2017 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@import "@material/theme/variables"; // for mdc-theme-accessible-ink-color
24@import "./variables";
25
26//
27// Public
28//
29
30@mixin mdc-toolbar-ink-color($color) {
31 @include mdc-theme-prop(color, $color);
32}
33
34@mixin mdc-toolbar-fill-color($color) {
35 @include mdc-theme-prop(background-color, $color);
36}
37
38@mixin mdc-toolbar-fill-color-accessible($color) {
39 @include mdc-toolbar-fill-color($color);
40 @include mdc-toolbar-ink-color(mdc-theme-accessible-ink-color($color));
41
42 .mdc-toolbar__icon {
43 @include mdc-toolbar-icon-ink-color(mdc-theme-accessible-ink-color($color));
44 }
45}
46
47@mixin mdc-toolbar-icon-ink-color($color) {
48 @include mdc-theme-prop(color, $color);
49 @include mdc-states($color);
50}
51
52//
53// Private
54//
55
56// Applies styles to the different types of icons that can exist in toolbars.
57// Both .mdc-toolbar__icon and .mdc-toolbar__menu-icon share all styles except for
58// horizontal padding.
59@mixin mdc-toolbar-icon_() {
60 @include mdc-ripple-surface;
61 @include mdc-ripple-radius-unbounded;
62
63 // mdc-states is included within the mdc-toolbar-icon-ink-color mixin
64
65 display: flex;
66 position: relative;
67 align-items: start;
68 justify-content: center;
69 box-sizing: border-box;
70 width: $mdc-toolbar-icon-size + $mdc-toolbar-icon-padding * 2;
71 height: $mdc-toolbar-icon-size + $mdc-toolbar-icon-padding * 2;
72 padding: $mdc-toolbar-icon-padding;
73 border: none;
74 outline: none;
75 background-color: transparent;
76 fill: currentColor;
77 color: inherit;
78 text-decoration: none;
79 cursor: pointer;
80}