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
118
119
120
|
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;
@include iro.props-namespace('lightbox') {
@include iro.props-store((
--dims: (
--pad-x: fn.global-dim(--size --150),
--pad-y: fn.global-dim(--size --150),
--spacing: fn.global-dim(--size --200),
--thumbnail: (
--size: fn.global-dim(--size --800),
--spacing: fn.global-dim(--size --100),
--selected: 3px,
),
--nav-btn: (
--font-size: fn.global-dim(--font-size --400),
--pad-x: fn.global-dim(--size --300),
--pad-y: fn.global-dim(--size --300),
),
),
), 'dims');
@include iro.props-store((
--dims: (
--thumbnail: (
--size: fn.global-dim(--size --600),
),
--nav-btn: (
--font-size: fn.global-dim(--font-size --300),
--pad-x: fn.global-dim(--size --150),
--pad-y: fn.global-dim(--size --150),
),
),
), 'md');
@include iro.props-store((
--colors: (
--thumbnail: (
--selected: fn.global-color(--fg-lo),
),
),
), 'colors');
@include iro.bem-object(iro.props-namespace()) {
display: grid;
grid-template-rows: auto minmax(0, 1fr) auto;
grid-template-columns: minmax(0, 1fr) auto;
grid-template-areas: 'header close' 'content content' 'footer footer';
gap: fn.dim(--spacing);
height: 100%;
@include iro.bem-elem('footer') {
grid-area: footer;
display: flex;
gap: fn.dim(--thumbnail --spacing);
padding: fn.dim(--thumbnail --selected);
overflow: auto;
}
@include iro.bem-elem('header') {
grid-area: header;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@include iro.bem-elem('img') {
box-sizing: border-box;
grid-area: content;
max-width: 100%;
max-height: 100%;
margin: auto;
padding: 0 calc(fn.dim(--nav-btn --font-size) + fn.dim(--nav-btn --pad-x));
}
@include iro.bem-elem('thumbnail') {
opacity: .75;
&:hover {
opacity: 1;
}
@include iro.bem-is('selected') {
opacity: 1;
box-shadow: 0 0 0 fn.dim(--thumbnail --selected) fn.color(--thumbnail --selected);
}
}
@include iro.bem-elem('thumbnail-img') {
display: block;
width: fn.dim(--thumbnail --size);
height: fn.dim(--thumbnail --size);
object-fit: cover;
object-position: center center;
}
@include iro.bem-elem('close-btn') {
--icon-stroke-width: 2px;
grid-area: close;
font-size: fn.global-dim(--font-size --150);
}
@include iro.bem-elem('prev-btn', 'next-btn') {
position: absolute;
top: 50%;
padding: fn.dim(--nav-btn --pad-y) fn.dim(--nav-btn --pad-x);
transform: translate(0, -50%);
font-size: fn.dim(--nav-btn --font-size);
}
@include iro.bem-elem('prev-btn') {
left: 0;
}
@include iro.bem-elem('next-btn') {
right: 0;
}
}
}
|