added dark theme option. It ìs selected automagically based on system choiche of...
[theme-danix.xyz.git] / assets / sass / components / _button.scss
CommitLineData
748286b5 1///\r
2/// Forty by HTML5 UP\r
3/// html5up.net | @ajlkn\r
4/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)\r
5///\r
6\r
7/* Button */\r
8\r
9 input[type="submit"],\r
10 input[type="reset"],\r
11 input[type="button"],\r
12 button,\r
13 .button {\r
14 @include vendor('appearance', 'none');\r
15 @include vendor('transition', (\r
16 'background-color #{_duration(transition)} ease-in-out',\r
17 'box-shadow #{_duration(transition)} ease-in-out',\r
18 'color #{_duration(transition)} ease-in-out'\r
19 ));\r
20 background-color: transparent;\r
21 border: 0;\r
22 border-radius: 0;\r
cb4379e1 23 box-shadow: inset 0 0 0 2px _palette_light(fg-bold);\r
24 color: _palette_light(fg-bold);\r
25 @media screen and (prefers-color-scheme: dark) {\r
26 box-shadow: inset 0 0 0 2px _palette_dark(fg-bold);\r
27 color: _palette_dark(fg-bold);\r
28 }\r
748286b5 29 cursor: pointer;\r
30 display: inline-block;\r
31 font-size: 0.8em;\r
32 font-weight: _font(weight-bold);\r
33 height: 3.5em;\r
34 letter-spacing: _font(letter-spacing-alt);\r
35 line-height: 3.5em;\r
36 padding: 0 1.75em;\r
37 text-align: center;\r
38 text-decoration: none;\r
39 text-transform: uppercase;\r
40 white-space: nowrap;\r
41\r
42 &:hover, &:active {\r
cb4379e1 43 box-shadow: inset 0 0 0 2px _palette_light(highlight);\r
44 color: _palette_light(highlight);\r
45 @media screen and (prefers-color-scheme: dark) {\r
46 box-shadow: inset 0 0 0 2px _palette_dark(highlight);\r
47 color: _palette_dark(highlight);\r
48 }\r
748286b5 49 }\r
50\r
51 &:active {\r
cb4379e1 52 background-color: transparentize(_palette_light(highlight), 0.9);\r
53 box-shadow: inset 0 0 0 2px desaturate(darken(_palette_light(highlight), 15), 5);\r
54 color: desaturate(darken(_palette_light(highlight), 15), 5);\r
55 @media screen and (prefers-color-scheme: dark) {\r
56 background-color: transparentize(_palette_dark(highlight), 0.9);\r
57 box-shadow: inset 0 0 0 2px desaturate(darken(_palette_dark(highlight), 15), 5);\r
58 color: desaturate(darken(_palette_dark(highlight), 15), 5);\r
59 }\r
748286b5 60 }\r
61\r
62 &.icon {\r
63 &:before {\r
64 margin-right: 0.5em;\r
65 }\r
66 }\r
67\r
68 &.fit {\r
69 width: 100%;\r
70 }\r
71\r
72 &.small {\r
73 font-size: 0.6em;\r
74 }\r
75\r
76 &.large {\r
77 font-size: 1.25em;\r
78 height: 3em;\r
79 line-height: 3em;\r
80 }\r
81\r
82 &.next {\r
83 padding-right: 4.5em;\r
84 position: relative;\r
85\r
86 &:before, &:after {\r
87 @include vendor('transition', 'opacity #{_duration(transition)} ease-in-out');\r
88 background-position: center right;\r
89 background-repeat: no-repeat;\r
90 background-size: 36px 24px;\r
91 content: '';\r
92 display: block;\r
93 height: 100%;\r
94 position: absolute;\r
95 right: 1.5em;\r
96 top: 0;\r
97 vertical-align: middle;\r
98 width: 36px;\r
99 }\r
100\r
101 &:before {\r
cb4379e1 102 background-image: svg-url('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="36px" height="24px" viewBox="0 0 36 24" zoomAndPan="disable"><style>line { stroke: #{_palette_light(fg-bold)}; stroke-width: 2px; }</style><line x1="0" y1="12" x2="34" y2="12" /><line x1="25" y1="4" x2="34" y2="12.5" /><line x1="25" y1="20" x2="34" y2="11.5" /></svg>');\r
103 @media screen and (prefers-color-scheme: dark) {\r
104 background-image: svg-url('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="36px" height="24px" viewBox="0 0 36 24" zoomAndPan="disable"><style>line { stroke: #{_palette_dark(fg-bold)}; stroke-width: 2px; }</style><line x1="0" y1="12" x2="34" y2="12" /><line x1="25" y1="4" x2="34" y2="12.5" /><line x1="25" y1="20" x2="34" y2="11.5" /></svg>');\r
105 }\r
748286b5 106 }\r
107\r
108 &:after {\r
cb4379e1 109 background-image: svg-url('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="36px" height="24px" viewBox="0 0 36 24" zoomAndPan="disable"><style>line { stroke: #{_palette_light(highlight)}; stroke-width: 2px; }</style><line x1="0" y1="12" x2="34" y2="12" /><line x1="25" y1="4" x2="34" y2="12.5" /><line x1="25" y1="20" x2="34" y2="11.5" /></svg>');\r
110 @media screen and (prefers-color-scheme: dark) {\r
111 background-image: svg-url('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="36px" height="24px" viewBox="0 0 36 24" zoomAndPan="disable"><style>line { stroke: #{_palette_dark(highlight)}; stroke-width: 2px; }</style><line x1="0" y1="12" x2="34" y2="12" /><line x1="25" y1="4" x2="34" y2="12.5" /><line x1="25" y1="20" x2="34" y2="11.5" /></svg>');\r
112 }\r
748286b5 113 opacity: 0;\r
114 z-index: 1;\r
115 }\r
116\r
117 &:hover, &:active {\r
118 &:after {\r
119 opacity: 1;\r
120 }\r
121 }\r
122\r
123 @include breakpoint('<=large') {\r
124 padding-right: 5em;\r
125 }\r
126 }\r
127\r
128 &.primary {\r
cb4379e1 129 background-color: _palette_light(fg-bold);\r
748286b5 130 box-shadow: none;\r
cb4379e1 131 color: _palette_light(bg);\r
132 @media screen and (prefers-color-scheme: dark) {\r
133 background-color: _palette_dark(fg-bold);\r
134 color: _palette_dark(bg);\r
135 }\r
748286b5 136\r
137 &:hover, &:active {\r
cb4379e1 138 background-color: _palette_light(highlight);\r
139 color: _palette_light(bg) !important;\r
140 @media screen and (prefers-color-scheme: dark) {\r
141 background-color: _palette_dark(highlight);\r
142 color: _palette_dark(bg) !important;\r
143 }\r
748286b5 144 }\r
145\r
146 &:active {\r
cb4379e1 147 background-color: desaturate(darken(_palette_light(highlight), 15), 5);\r
148 @media screen and (prefers-color-scheme: dark) {\r
149 background-color: desaturate(darken(_palette_dark(highlight), 15), 5);\r
150 }\r
748286b5 151 }\r
152 }\r
153\r
154 &.disabled,\r
155 &:disabled {\r
156 @include vendor('pointer-events', 'none');\r
157 cursor: default;\r
158 opacity: 0.25;\r
159 }\r
160 }