-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy path_cards.scss
158 lines (132 loc) · 3.14 KB
/
_cards.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// Adapted from Bootstrap v5.0.2 (https://getbootstrap.com/)
// Copyright 2011-2019 The Bootstrap Authors
// Copyright 2011-2019 Twitter, Inc.
// Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
@use 'sass:math';
.sd-card {
background-clip: border-box;
background-color: var(--sd-color-card-background);
border: 1px solid var(--sd-color-card-border);
border-radius: 0.25rem;
color: var(--sd-color-card-text);
display: -ms-flexbox;
display: flex;
-ms-flex-direction: column;
flex-direction: column;
min-width: 0;
position: relative;
word-wrap: break-word;
> hr {
margin-left: 0;
margin-right: 0;
}
}
.sd-card-hover:hover {
border-color: var(--sd-color-card-border-hover);
transform: scale(1.01);
}
.sd-card-body {
-ms-flex: 1 1 auto;
flex: 1 1 auto;
padding: 1rem 1rem;
}
.sd-card-title {
margin-bottom: 0.5rem;
}
.sd-card-subtitle {
margin-top: -0.25rem;
margin-bottom: 0;
}
.sd-card-text:last-child {
margin-bottom: 0;
}
.sd-card-link:hover {
text-decoration: none;
}
.sd-card-link + .card-link {
margin-left: 1rem;
}
.sd-card-header {
padding: 0.5rem 1rem;
margin-bottom: 0;
background-color: var(--sd-color-card-header);
border-bottom: 1px solid var(--sd-color-card-border);
}
.sd-card-header:first-child {
border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0;
}
.sd-card-footer {
padding: 0.5rem 1rem;
background-color: var(--sd-color-card-footer);
border-top: 1px solid var(--sd-color-card-border);
}
.sd-card-footer:last-child {
border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px);
}
.sd-card-header-tabs {
margin-right: -0.5rem;
margin-bottom: -0.5rem;
margin-left: -0.5rem;
border-bottom: 0;
}
.sd-card-header-pills {
margin-right: -0.5rem;
margin-left: -0.5rem;
}
.sd-card-img-overlay {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: 1rem;
border-radius: calc(0.25rem - 1px);
}
.sd-card-img,
.sd-card-img-bottom,
.sd-card-img-top {
width: 100%;
}
.sd-card-img,
.sd-card-img-top {
border-top-left-radius: calc(0.25rem - 1px);
border-top-right-radius: calc(0.25rem - 1px);
}
.sd-card-img,
.sd-card-img-bottom {
border-bottom-left-radius: calc(0.25rem - 1px);
border-bottom-right-radius: calc(0.25rem - 1px);
}
// sd-cards-carousel is not part of bootstrap
// it is intended to create a single row of scrollable cards
// with a standard width for each card
.sd-cards-carousel {
width: 100%;
display: flex;
flex-wrap: nowrap;
-ms-flex-direction: row;
flex-direction: row;
overflow-x: hidden;
scroll-snap-type: x mandatory;
}
// use to always show the scroll bar
.sd-cards-carousel.sd-show-scrollbar {
overflow-x: auto;
}
.sd-cards-carousel:hover, .sd-cards-carousel:focus {
overflow-x: auto;
}
.sd-cards-carousel > .sd-card {
flex-shrink: 0;
scroll-snap-align: start;
}
.sd-cards-carousel > .sd-card:not(:last-child) {
margin-right: 3px;
}
@for $i from 1 through 12 {
.sd-card-cols-#{$i} > .sd-card {
// we use less than 100% here, so that the (i+1)th card will be slightly visible,
// so the user is aware that there are more cards available
width: math.div(90%, $i);
}
}