-
Notifications
You must be signed in to change notification settings - Fork 152
/
Bar.styl
68 lines (59 loc) · 1.22 KB
/
Bar.styl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
$bar-size= 25px
// the rotated label trick, see: https://gist.github.com/aiboy/7406727
.side-bar {
display: flex;
noSelect()
&.left, &.right {
width: $bar-size;
flex-direction: column;
.side-bar-label {
padding-tb: 5px;
text-align right;
}
}
&.top, &.bottom {
height: $bar-size;
flex-direction: row;
.side-bar-label {
padding-lr: 5px;
text-align center;
}
}
.side-bar-label {
cursor: pointer;
overflow: hidden;
&.active {
background-color: gray(90%);
}
}
&.top, &.bottom {
.side-bar-label-container {
display: flex;
align-items: center;
height: 100%;
}
}
&.left, &.right {
.side-bar-label-container {
display: inline-block;
white-space: nowrap;
transform: translate(0.9em, -0.5em) rotate(90deg);
transform-origin: 0 0.5em;
&:before {
// this is the key, it keeps the box from collapse
content: "";
float: right;
margin-bottom: 100%;
}
}
}
.side-bar-label-content {
display: flex;
line-height: 1;
align-items: center;
.icon {margin-right: 4px}
}
&.left .side-bar-label-content {
transform: rotate(180deg);
}
}