forked from benmag1/mdl-ext
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_carousel.scss
141 lines (123 loc) · 3.48 KB
/
_carousel.scss
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
@charset "UTF-8";
/**
* Copyright 2016 Leif Olsen. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* A carousel ...
*/
// Use of this module requires the user to include variables from material-design-lite
//@import "../../node_modules/material-design-lite/src/variables";
//@import "../../node_modules/material-design-lite/src/mixins";
ul.mdlext-carousel {
list-style: none;
}
.mdlext-carousel {
box-sizing: border-box;
margin: 0;
padding: 0;
overflow: hidden;
height: 100%; // Use a container to constrain height and width
width: 100%;
display: block;
white-space: nowrap;
font-size: 0;
background-color: transparent;
}
.mdlext-carousel__slide {
box-sizing: border-box;
display: inline-block;
position: relative;
outline: 0;
margin: 0 $mdlext-carousel-slide-margin-horizontal;
padding:0;
height: 100%;
border-top: $mdlext-carousel-slide-border-top-width solid transparent; // Makes room for the animated select/focus line
//&:focus,
&[aria-selected],
&[aria-selected='true'] {
figcaption {
// As far as I can see there is no way to darken/lighten a text color
// defined by MDL, due to the "unqote" functions.
// So this is a hack
color: rgba(0, 0, 0, 1) !important;
background-color: rgba(255, 255, 255, 0.25);
}
}
&[aria-selected]::after,
&[aria-selected='true']::after {
height: $mdlext-carousel-slide-border-top-width;
width: 100%;
display: block;
content: ' ';
top: (-$mdlext-carousel-slide-border-top-width);
left: 0;
position: absolute;
background: $mdlext-carousel-slide-border-top-color;
animation: border-expand 0.2s cubic-bezier(0.4, 0.0, 0.4, 1) 0.01s alternate forwards;
transition: all 1s cubic-bezier(0.4, 0.0, 1, 1);
}
a {
text-decoration: none;
}
figure {
box-sizing: border-box;
position: relative;
height: 100%;
margin: 0;
padding: 0;
img {
box-sizing: border-box;
max-height: 100%;
}
figcaption {
box-sizing: border-box;
@include typo-caption($colorContrast: false, $usePreferred: true);
color: $mdlext-carousel-slide-figcaption-color;
position: absolute;
bottom: 0;
left: 0;
white-space: nowrap;
overflow: hidden;
max-width: 100%;
width: 100%;
text-align: center;
text-overflow: ellipsis;
padding: 4px 0;
}
&:hover {
figcaption {
// As far as I can see there is no way to darken/lighten a text color
// defined by MDL, due to the "unqote" functions.
// So this is a hack
color: rgba(0, 0, 0, 1) !important;
background-color: rgba(255, 255, 255, 0.25);
}
}
}
.mdlext-carousel__slide__ripple-container {
text-decoration: none;
display: block;
overflow: hidden;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
outline: 0;
& .mdl-ripple {
background: $mdlext-carousel-slide-ripple-color;
}
}
}