Debian Codegraph @

style/_cards.scss

raw
1 // Adapted from Bootstrap v5.0.2 (https://getbootstrap.com/)
2 // Copyright 2011-2019 The Bootstrap Authors
3 // Copyright 2011-2019 Twitter, Inc.
4 // Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 @use 'sass:math';
6
7 .sd-card {
8 background-clip: border-box;
9 background-color: var(--sd-color-card-background);
10 border: 1px solid var(--sd-color-card-border);
11 border-radius: 0.25rem;
12 color: var(--sd-color-card-text);
13 display: -ms-flexbox;
14 display: flex;
15 -ms-flex-direction: column;
16 flex-direction: column;
17 min-width: 0;
18 position: relative;
19 word-wrap: break-word;
20
21 > hr {
22 margin-left: 0;
23 margin-right: 0;
24 }
25 }
26
27 .sd-card-hover:hover {
28 border-color: var(--sd-color-card-border-hover);
29 transform: scale(1.01);
30 }
31
32 .sd-card-body {
33 -ms-flex: 1 1 auto;
34 flex: 1 1 auto;
35 padding: 1rem 1rem;
36 }
37
38 .sd-card-title {
39 margin-bottom: 0.5rem;
40 }
41
42 .sd-card-subtitle {
43 margin-top: -0.25rem;
44 margin-bottom: 0;
45 }
46
47 .sd-card-text:last-child {
48 margin-bottom: 0;
49 }
50
51 .sd-card-link:hover {
52 text-decoration: none;
53 }
54
55 .sd-card-link + .card-link {
56 margin-left: 1rem;
57 }
58
59 .sd-card-header {
60 padding: 0.5rem 1rem;
61 margin-bottom: 0;
62 background-color: var(--sd-color-card-header);
63 border-bottom: 1px solid var(--sd-color-card-border);
64 }
65
66 .sd-card-header:first-child {
67 border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0;
68 }
69
70 .sd-card-footer {
71 padding: 0.5rem 1rem;
72 background-color: var(--sd-color-card-footer);
73 border-top: 1px solid var(--sd-color-card-border);
74 }
75
76 .sd-card-footer:last-child {
77 border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px);
78 }
79
80 .sd-card-header-tabs {
81 margin-right: -0.5rem;
82 margin-bottom: -0.5rem;
83 margin-left: -0.5rem;
84 border-bottom: 0;
85 }
86
87 .sd-card-header-pills {
88 margin-right: -0.5rem;
89 margin-left: -0.5rem;
90 }
91
92 .sd-card-img-overlay {
93 position: absolute;
94 top: 0;
95 right: 0;
96 bottom: 0;
97 left: 0;
98 padding: 1rem;
99 border-radius: calc(0.25rem - 1px);
100 }
101
102 .sd-card-img,
103 .sd-card-img-bottom,
104 .sd-card-img-top {
105 width: 100%;
106 }
107
108 .sd-card-img,
109 .sd-card-img-top {
110 border-top-left-radius: calc(0.25rem - 1px);
111 border-top-right-radius: calc(0.25rem - 1px);
112 }
113
114 .sd-card-img,
115 .sd-card-img-bottom {
116 border-bottom-left-radius: calc(0.25rem - 1px);
117 border-bottom-right-radius: calc(0.25rem - 1px);
118 }
119
120 // sd-cards-carousel is not part of bootstrap
121 // it is intended to create a single row of scrollable cards
122 // with a standard width for each card
123
124 .sd-cards-carousel {
125 width: 100%;
126 display: flex;
127 flex-wrap: nowrap;
128 -ms-flex-direction: row;
129 flex-direction: row;
130 overflow-x: hidden;
131 scroll-snap-type: x mandatory;
132 }
133
134 // use to always show the scroll bar
135 .sd-cards-carousel.sd-show-scrollbar {
136 overflow-x: auto;
137 }
138
139 .sd-cards-carousel:hover, .sd-cards-carousel:focus {
140 overflow-x: auto;
141 }
142
143 .sd-cards-carousel > .sd-card {
144 flex-shrink: 0;
145 scroll-snap-align: start;
146 }
147
148 .sd-cards-carousel > .sd-card:not(:last-child) {
149 margin-right: 3px;
150 }
151
152 @for $i from 1 through 12 {
153 .sd-card-cols-#{$i} > .sd-card {
154 // we use less than 100% here, so that the (i+1)th card will be slightly visible,
155 // so the user is aware that there are more cards available
156 width: math.div(90%, $i);
157 }
158 }