This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
image-view.less
117 lines (93 loc) · 2.35 KB
/
image-view.less
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
@import "ui-variables";
@spacing: @component-padding/2;
@transparent-background-image: "atom://image-view/images/transparent-background.png";
.image-view {
display: flex;
flex-direction: column;
background-color: @pane-item-background-color;
user-select: none;
// Image Controls -------------------
.image-controls {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
padding: @spacing;
border-bottom: 1px solid @panel-heading-border-color;
background-color: @panel-heading-background-color;
a {
display: inline-block;
position: relative;
width: 24px;
height: 24px;
margin: @spacing;
vertical-align: middle;
font-size: 0;
border-radius: 22px;
border: 2px solid #fff;
box-shadow: inset 0 1px 2px hsla(0,0%,0%,.4), 0 0 0 1px hsla(0,0%,0%,.1), 0 2px 2px hsla(0,0%,0%,.2);
background-clip: content-box;
&:hover {
border-color: #ccc;
}
&:active {
border-color: #999;
}
}
&-color-white {
color: #000;
background-color: #fff;
background-image: url(@transparent-background-image);
}
&-color-black {
color: #fff;
background-color: #000;
background-image: url(@transparent-background-image);
}
.btn-group {
margin: @spacing;
}
.reset-zoom-button {
min-width: 5em;
}
// disabled once the button is selected
.zoom-to-fit-button.selected {
pointer-events: none;
cursor: default;
}
}
// Image -------------------
.image-container {
flex: 1 1 0;
display: flex;
overflow: auto;
img {
flex: none;
margin: auto;
}
}
// Background color
[background="white"] {
background-color: white;
background-image: url(@transparent-background-image);
}
[background="black"] {
background-color: black;
background-image: url(@transparent-background-image);
}
// Zoom to fit -------------------
// Scales the image to fit the available space.
.zoom-to-fit {
&.image-container {
padding: @component-padding;
img {
flex: 1 1 0;
min-width: 0;
margin: 0;
// Alternative: object-fit: contain;
// then it would also scale larger than its original size
object-fit: scale-down;
}
}
}
}