Skip to content

Commit 6d5553b

Browse files
zetareticoliastagi
authored andcommitted
refactor: simplified callout
1 parent 6f22a65 commit 6d5553b

1 file changed

Lines changed: 12 additions & 66 deletions

File tree

src/scss/components/_callout.scss

Lines changed: 12 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,16 @@
33
overflow: hidden;
44

55
.callout-inner {
6-
padding: 2rem;
6+
padding: 1.5rem;
77
border: 2px solid $color-border-secondary;
8-
border-top: 0;
9-
margin: 2.5rem 0;
8+
margin: 2rem 0;
109
}
1110

1211
&.callout-highlight {
1312
border: none;
1413
border-left: 2px solid $color-border-secondary;
1514
border-radius: 0;
16-
padding: 0 2.222rem;
17-
18-
p:last-child {
19-
margin: 0;
20-
}
21-
22-
.callout-title {
23-
margin-bottom: 1.556rem;
24-
}
25-
26-
@each $color-name, $color-value in (success: $success, warning: $color-border-warning, danger: $danger, important: $success, note: $primary) {
27-
&.#{$color-name} {
28-
border-color: $color-value;
29-
}
30-
}
15+
padding: 0 1.5rem;
3116
}
3217

3318
&.callout-more {
@@ -131,11 +116,13 @@
131116
}
132117

133118
.callout-title {
119+
display: flex;
120+
align-items: center;
121+
margin-bottom: 1rem;
134122
font-weight: 600;
135123
text-transform: uppercase;
136124
font-size: 1rem;
137125
color: $color-text-secondary;
138-
139126
@include media-breakpoint-up(lg) {
140127
font-size: 1.125rem;
141128
}
@@ -146,53 +133,18 @@
146133
}
147134
}
148135

149-
&:not(.callout-highlight):not(.callout-more) {
150-
.callout-title {
151-
position: relative;
152-
padding-left: 1.5rem;
153-
top: -3rem;
154-
155-
.text {
156-
position: relative;
157-
overflow: hidden;
158-
width: 100%;
159-
font-size: 0.875rem;
160-
padding-right: 1.5rem;
161-
162-
@include media-breakpoint-up(md) {
163-
font-size: 1.15rem;
164-
}
165-
166-
&:after {
167-
content: '';
168-
top: 0.875em;
169-
border-top: 2px solid;
170-
position: absolute;
171-
width: calc(100vw - 100% - 20px);
172-
left: 100%;
173-
}
174-
}
175-
176-
&:before {
177-
content: '';
178-
top: 0.875em;
179-
border-top: 2px solid;
180-
position: absolute;
181-
width: 3rem;
182-
left: -2.5rem;
183-
}
184-
}
185-
}
186-
187136
p {
188137
font-family: $font-family-serif;
189138
font-size: 1rem;
190139
color: $color-text-secondary;
191-
192140
@include media-breakpoint-up(lg) {
193141
font-size: 1.125rem;
194142
}
195143

144+
&:last-child {
145+
margin-bottom: 0;
146+
}
147+
196148
&.callout-big-text {
197149
font-size: 1.125rem;
198150
}
@@ -304,13 +256,7 @@
304256
}
305257

306258
@media (min-width: 768px) {
307-
.callout {
308-
&.callout-highlight {
309-
padding: 0 0 0 2.222rem;
310-
}
311-
312-
&.callout-more p {
313-
font-size: 0.775rem;
314-
}
259+
.callout .callout-more p {
260+
font-size: 0.775rem;
315261
}
316262
}

0 commit comments

Comments
 (0)