blob: 674751a0128be859641301cc4669f5d241c28aed [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 carousel ...
21 */
22
23// Use of this module requires the user to include variables from material-design-lite
24//@import "../../node_modules/material-design-lite/src/variables";
25//@import "../../node_modules/material-design-lite/src/mixins";
26
27ul.mdlext-carousel {
28 list-style: none;
29}
30
31.mdlext-carousel {
32 box-sizing: border-box;
33 margin: 0;
34 padding: 0;
35 overflow: hidden;
36 height: 100%; // Use a container to constrain height and width
37 width: 100%;
38 display: block;
39 white-space: nowrap;
40 font-size: 0;
41 background-color: transparent;
42}
43
44.mdlext-carousel__slide {
45 box-sizing: border-box;
46 display: inline-block;
47 position: relative;
48 outline: 0;
49 margin: 0 $mdlext-carousel-slide-margin-horizontal;
50 padding:0;
51 height: 100%;
52 border-top: $mdlext-carousel-slide-border-top-width solid transparent; // Makes room for the animated select/focus line
53
54 //&:focus,
55 &[aria-selected],
56 &[aria-selected='true'] {
57 figcaption {
58 // As far as I can see there is no way to darken/lighten a text color
59 // defined by MDL, due to the "unqote" functions.
60 // So this is a hack
61 color: rgba(0, 0, 0, 1) !important;
62 background-color: rgba(255, 255, 255, 0.25);
63 }
64 }
65
66 &[aria-selected]::after,
67 &[aria-selected='true']::after {
68 height: $mdlext-carousel-slide-border-top-width;
69 width: 100%;
70 display: block;
71 content: ' ';
72 top: (-$mdlext-carousel-slide-border-top-width);
73 left: 0;
74 position: absolute;
75 background: $mdlext-carousel-slide-border-top-color;
76 animation: border-expand 0.2s cubic-bezier(0.4, 0.0, 0.4, 1) 0.01s alternate forwards;
77 transition: all 1s cubic-bezier(0.4, 0.0, 1, 1);
78 }
79
80
81 a {
82 text-decoration: none;
83 }
84
85 figure {
86 box-sizing: border-box;
87 position: relative;
88 height: 100%;
89 margin: 0;
90 padding: 0;
91
92 img {
93 box-sizing: border-box;
94 max-height: 100%;
95 }
96
97 figcaption {
98 box-sizing: border-box;
99 @include typo-caption($colorContrast: false, $usePreferred: true);
100
101 color: $mdlext-carousel-slide-figcaption-color;
102 position: absolute;
103 bottom: 0;
104 left: 0;
105 white-space: nowrap;
106 overflow: hidden;
107 max-width: 100%;
108 width: 100%;
109 text-align: center;
110 text-overflow: ellipsis;
111 padding: 4px 0;
112 }
113 &:hover {
114 figcaption {
115 // As far as I can see there is no way to darken/lighten a text color
116 // defined by MDL, due to the "unqote" functions.
117 // So this is a hack
118 color: rgba(0, 0, 0, 1) !important;
119 background-color: rgba(255, 255, 255, 0.25);
120 }
121 }
122 }
123
124 .mdlext-carousel__slide__ripple-container {
125 text-decoration: none;
126 display: block;
127 overflow: hidden;
128 position: absolute;
129 top: 0;
130 left: 0;
131 right: 0;
132 bottom: 0;
133 outline: 0;
134
135 & .mdl-ripple {
136 background: $mdlext-carousel-slide-ripple-color;
137 }
138 }
139}
140
141