Skip to content

Commit 95c3cc5

Browse files
committed
Styles: Improved callout RTL support
Will now adapt using logical styles where supported, will fallbacks to old fixed LTR positioning where not supported. For #5104
1 parent 60c5370 commit 95c3cc5

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

resources/sass/_content.scss

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,18 @@ body .page-content img,
127127

128128
/**
129129
* Callouts
130+
* Some styles duplicated for supporting logical units (eg. inline-end) while
131+
* providing fallbacks to non-logical rules, so RTL is natively supported where possible.
130132
*/
131133
.callout {
132134
border-left: 3px solid #BBB;
135+
border-inline-start: 3px solid #BBB;
136+
border-inline-end: none;
133137
background-color: #EEE;
134-
padding: $-s $-s $-s $-xl;
138+
padding: $-s;
139+
padding-left: $-xl;
140+
padding-inline-start: $-xl;
141+
padding-inline-end: $-s;
135142
display: block;
136143
position: relative;
137144
overflow: auto;
@@ -142,6 +149,8 @@ body .page-content img,
142149
width: 1.2em;
143150
height: 1.2em;
144151
left: $-xs + 2px;
152+
inset-inline-start: $-xs + 2px;
153+
inset-inline-end: unset;
145154
top: 50%;
146155
margin-top: -9px;
147156
display: inline-block;
@@ -150,28 +159,28 @@ body .page-content img,
150159
opacity: 0.8;
151160
}
152161
&.success {
153-
@include lightDark(border-left-color, $positive, $positive-dark);
162+
@include lightDark(border-color, $positive, $positive-dark);
154163
@include lightDark(background-color, lighten($positive, 68%), darken($positive-dark, 36%));
155164
@include lightDark(color, darken($positive, 16%), $positive-dark);
156165
}
157166
&.success:before {
158167
background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMzNzZjMzkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6Ii8+PC9zdmc+");
159168
}
160169
&.danger {
161-
@include lightDark(border-left-color, $negative, $negative-dark);
170+
@include lightDark(border-color, $negative, $negative-dark);
162171
@include lightDark(background-color, lighten($negative, 56%), darken($negative-dark, 55%));
163172
@include lightDark(color, darken($negative, 20%), $negative-dark);
164173
}
165174
&.danger:before {
166175
background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiOTE4MTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0xNS43MyAzSDguMjdMMyA4LjI3djcuNDZMOC4yNyAyMWg3LjQ2TDIxIDE1LjczVjguMjdMMTUuNzMgM3pNMTIgMTcuM2MtLjcyIDAtMS4zLS41OC0xLjMtMS4zIDAtLjcyLjU4LTEuMyAxLjMtMS4zLjcyIDAgMS4zLjU4IDEuMyAxLjMgMCAuNzItLjU4IDEuMy0xLjMgMS4zem0xLTQuM2gtMlY3aDJ2NnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==");
167176
}
168177
&.info {
169-
@include lightDark(border-left-color, $info, $info-dark);
178+
@include lightDark(border-color, $info, $info-dark);
170179
@include lightDark(color, darken($info, 20%), $info-dark);
171180
@include lightDark(background-color, lighten($info, 50%), darken($info-dark, 34%));
172181
}
173182
&.warning {
174-
@include lightDark(border-left-color, $warning, $warning-dark);
183+
@include lightDark(border-color, $warning, $warning-dark);
175184
@include lightDark(background-color, lighten($warning, 50%), darken($warning-dark, 50%));
176185
@include lightDark(color, darken($warning, 20%), $warning-dark);
177186
}

0 commit comments

Comments
 (0)