blob: 775d2834bde62f026cbba5f95aa969a9aab60777 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001@charset "UTF-8";
2
3/**
4 * Copyright 2016 Leif Olsen. All Rights Reserved.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19/*
20 * A lightboard is a translucent surface illuminated from behind, used for situations
21 * where a shape laid upon the surface needs to be seen with high contrast. In the "old days" of photography
22 * photograpers used a lightboard to get a quick view of their slides. The goal is to create a responsive lightbox
23 * design, based on flex layout, similar to what is used in Adobe LightRoom to browse images.
24 */
25
26// Use of this module requires the user to include variables from material-design-lite
27//@import "../../node_modules/material-design-lite/src/variables";
28//@import "../../node_modules/material-design-lite/src/mixins";
29@import "../variables";
30
31ul.mdlext-lightboard {
32 list-style: none;
33}
34
35.mdlext-lightboard {
36 box-sizing: border-box;
37 margin: 0 auto;
38 padding: 0;
39 display: flex;
40 flex-flow:row wrap;
41 align-items: stretch;
42
43 *,
44 *::before,
45 *::after,
46 input[type="search"] {
47 box-sizing: border-box;
48 }
49
50 .mdlext-lightboard__slide {
51 background-color: $mdlext-lightboard-slide-background-color;
52 border: 1px solid $mdlext-lightboard-slide-border-color;
53 border-radius: $mdlext-lightboard-slide-border-radius;
54 box-shadow: $mdlext-lightboard-slide-box-shadow;
55 position: relative;
56 display: block;
57 max-width: $mdlext-lightboard-slide-max-size;
58
59 &::before {
60 // 1:1 ratio
61 // TODO: Use a class for ratio so the grid can display slides with different ratios (16:9, 16:10, 4:3 ...)
62 content: '';
63 display: block;
64 padding-top: 100%;
65 }
66 &:hover,
67 &:active,
68 &:focus {
69 border-color: $mdlext-lightboard-slide-border-color-hover;
70 background-color: $mdlext-lightboard-slide-background-color-hover;
71 box-shadow: $mdlext-lightboard-slide-box-shadow-hover;
72
73 figcaption {
74 color: rgba(0, 0, 0, 1) !important;
75 background-color: rgba(255, 255, 255, 0.2);
76 }
77 }
78 &:focus {
79 outline-offset: -2px;
80 outline-color: $mdlext-lightboard-focus-outline-color;
81 }
82 &[aria-selected='true'] {
83 background-color: $mdlext-lightboard-slide-active-bacground-color;
84
85 figcaption {
86 color: rgba(0, 0, 0, 1) !important;
87 background-color: rgba(255, 255, 255, 0.2);
88 }
89 }
90 &__frame,
91 &__ripple-container {
92 text-decoration: none;
93 display: block;
94 overflow: hidden;
95 position: absolute;
96 top: 0;
97 left: 0;
98 right: 0;
99 bottom: 0;
100
101 &:focus {
102 outline-offset: -2px;
103 outline-color: $mdlext-lightboard-focus-outline-color;
104 }
105 & .mdl-ripple {
106 background: $mdlext-lightboard-ripple-color;
107 }
108 figure {
109 display: block;
110 position: absolute;
111 top: 0;
112 left: 0;
113 right: 0;
114 bottom: 0;
115
116 img {
117 position: absolute;
118 top: 0;
119 left: 0;
120 right: 0;
121 bottom: 0;
122 margin: auto;
123 max-width: 100%;
124 max-height: 100%;
125 border-width: 0;
126 border-radius: $mdlext-lightboard-slide-inner-border-radius;
127 }
128 figcaption {
129 @include typo-caption($colorContrast: false, $usePreferred: true);
130
131 color: $mdlext-lightboard-figcaption-text-color;
132 position: absolute;
133 bottom: -2px;
134 white-space: nowrap;
135 overflow: hidden;
136 max-width: 100%;
137 width: 100%;
138 text-align: center;
139 text-overflow: ellipsis;
140 padding: 4px 0;
141 }
142 }
143 &:hover {
144 figcaption {
145 // As far as I can see there is no way to darken/lighten a text color
146 // defined by MDL, due to the "unqote" functions.
147 // So this is a hack
148 color: rgba(0, 0, 0, 1) !important;
149 background-color: rgba(255, 255, 255, 0.2);
150 }
151 }
152 }
153 }
154}
155
156////// Media / Element queries default, Small //////
157.mdlext-lightboard {
158 padding: calc((#{$mdlext-lightboard-small-margin} - #{$mdlext-lightboard-small-gutter}) / 2);
159
160 .mdlext-lightboard__slide {
161 margin: calc(#{$mdlext-lightboard-small-gutter} / 2);
162 width: calc(1 / #{$mdlext-lightboard-small-columns} * 100% - #{$mdlext-lightboard-small-gutter});
163
164 .mdlext-lightboard__slide__frame figure {
165 margin: $mdlext-lightboard-small-frame-width;
166 }
167 }
168 &.mdlext-lightboard--no-spacing {
169 padding: 0;
170
171 .mdlext-lightboard__slide {
172 margin: 0;
173 width: calc(1 / #{$mdlext-lightboard-small-columns} * 100%);
174 }
175 }
176}
177
178// Import one of _lightboard-media-queries.scss or _lightboard-eq-js.scss to complete SASS