Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: css/io-toggle.scss

Issue 29730644: Issue 6514 - IOToggle Custom Element (Closed)
Patch Set: Created March 26, 2018, 2:24 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 io-toggle {
Thomas Greiner 2018/04/25 17:29:14 Coding style: "Opening braces always go on their o
a.giammarchi 2018/04/26 10:44:51 have we published this eyeo style thing somewhere
Thomas Greiner 2018/04/26 17:00:52 Yep, two weeks ago we've published the stylelint-c
2 --width: 30px;
saroyanm 2018/04/25 17:05:01 While we are using SASS, wouldn't that make more s
a.giammarchi 2018/04/26 10:44:51 I think the whole point of dropping Edge 14 was to
Thomas Greiner 2018/04/26 17:00:51 I'd argue that we want to rely on web standards as
a.giammarchi 2018/04/27 10:59:04 this doesn't address the fact CSS variables are al
Thomas Greiner 2018/05/02 11:53:28 That's also what I'm saying that we should always
3 --height: 8px;
4 --translateY: -4px;
5 --translateX: 14px;
6 display: inline-block;
7 width: var(--width);
8 height: var(--height);
9 border-radius: 4px;
10 background-color: #9b9b9b;
saroyanm 2018/04/25 17:05:01 Having colors set separately will make it easy to
a.giammarchi 2018/04/26 10:44:51 Yeah. Colors might be one of those immutable share
11 transition: background .2s ease-out;
Thomas Greiner 2018/04/25 17:29:13 Technically, we only expect "background-color" to
Thomas Greiner 2018/04/25 17:29:13 Coding style: "Don't omit the optional leading 0 f
a.giammarchi 2018/04/26 10:44:51 AFAIK that doesn't work. will change wants backgro
Thomas Greiner 2018/04/26 17:00:51 Interesting. I wasn't aware of that. No problem wi
12 will-change: background;
13 cursor: pointer;
14 }
15
16 io-toggle[checked] {
17 background-color: #92d3ea;
Thomas Greiner 2018/04/25 17:29:13 How did you choose the colors? At least this one i
a.giammarchi 2018/04/26 10:44:51 I have downloaded specs images and picked color th
Thomas Greiner 2018/04/26 17:00:51 Since the part of the spec I referred to only appl
a.giammarchi 2018/04/27 10:59:04 AFAIK Jeen already approved this component and wan
Thomas Greiner 2018/05/02 11:53:27 Acknowledged.
18 }
19
20 io-toggle[disabled] {
21 opacity: 0.5;
22 cursor: default;
23 }
24
25 io-toggle button {
26 width: calc(var(--height) * 2);
27 height: calc(var(--height) * 2);
28 padding: 0;
29 border: 2px solid #e1e0e1;
30 border-radius: var(--height);
31 transition: border .2s ease-out, box-shadow .2s ease-out,
32 transform .2s ease-out, width .2s ease-out;
33 will-change: border, box-shadow, transform, width;
34 transform: translateY(var(--translateY));
35 outline: none;
36 cursor: pointer;
37 }
38
39 io-toggle button[aria-checked="false"]
40 {
41 background-color: #f1f1f1;
42 box-shadow: 0 1px 2px 0 #e5d1d1;
43 }
44
45 io-toggle button[aria-checked="false"]:hover
46 {
47 box-shadow: 0 2px 4px 0 #d3b0b0;
48 }
49
50 io-toggle button[aria-checked="true"]
51 {
52 background-color: #059cd0;
53 border: 2px solid #059cd0;
54 box-shadow: 0 1px 2px 0 #a6cede;
55 transform: translateY(var(--translateY)) translateX(var(--translateX));
56 }
57
58 io-toggle button[aria-checked="true"]:hover
59 {
60 box-shadow: 0 2px 4px 0 #a6cede;
61 }
62
63 io-toggle button:focus,
64 io-toggle button[aria-checked="true"]:focus
65 {
66 border: 2px solid #87bffe;
67 }
68
69 /* in case we will need to switch active/disabled direction
Thomas Greiner 2018/04/25 17:29:13 I was also wondering about that and it appears tha
a.giammarchi 2018/04/26 10:44:50 it took me a little while to figure this out, so I
Thomas Greiner 2018/04/26 17:00:52 For some reason I thought you were talking about t
a.giammarchi 2018/04/27 10:59:04 I'll double check with Jeen before eventually remo
Thomas Greiner 2018/05/02 11:53:27 Acknowledged.
70 body[dir="rtl"] io-toggle button[aria-checked="true"]
71 {
72 transform: translateY(var(--translateY)) translateX(calc(var(--translateX) * - 1));
73 }
74 //*/
OLDNEW

Powered by Google App Engine
This is Rietveld