Skip to content

Commit e35000e

Browse files
authored
fix(style): use container queries for responsive design (#10763)
1 parent fb78dd2 commit e35000e

5 files changed

Lines changed: 17 additions & 14 deletions

File tree

src/style/_form.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ select {
3333

3434
.opblock-body select {
3535
min-width: 230px;
36-
@media (max-width: 768px) {
36+
@container swagger-ui (max-width: 768px) {
3737
min-width: 180px;
3838
}
39-
@media (max-width: 640px) {
39+
@container swagger-ui (max-width: 640px) {
4040
width: 100%;
4141
min-width: 100%;
4242
}
@@ -58,7 +58,7 @@ input[type="email"],
5858
input[type="file"] {
5959
line-height: 1;
6060

61-
@media (max-width: 768px) {
61+
@container swagger-ui (max-width: 768px) {
6262
max-width: 175px;
6363
}
6464
}

src/style/_layout.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
font-weight: 400;
7979
}
8080

81-
@media (max-width: 640px) {
81+
@container swagger-ui (max-width: 640px) {
8282
small {
8383
flex: 1;
8484
}
@@ -262,7 +262,7 @@
262262

263263
@include type.text_headline($opblock-summary-method-font-color);
264264

265-
@media (max-width: 768px) {
265+
@container swagger-ui (max-width: 768px) {
266266
font-size: 12px;
267267
}
268268
}
@@ -279,7 +279,7 @@
279279

280280
@include type.text_code();
281281

282-
@media (max-width: 768px) {
282+
@container swagger-ui (max-width: 768px) {
283283
font-size: 12px;
284284
}
285285
}
@@ -288,7 +288,7 @@
288288
flex-shrink: 1;
289289
}
290290

291-
@media (max-width: 640px) {
291+
@container swagger-ui (max-width: 640px) {
292292
.opblock-summary-path {
293293
max-width: 100%;
294294
}
@@ -322,7 +322,7 @@
322322
flex-grow: 1;
323323
}
324324

325-
@media (max-width: 550px) {
325+
@container swagger-ui (max-width: 550px) {
326326
.opblock-summary-path-description-wrapper {
327327
flex-direction: column;
328328
align-items: flex-start;

src/style/_mixins.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,22 @@ $browser-context: 16;
112112
}
113113

114114
@mixin maxHeight($height) {
115-
@media (max-height: $height) {
115+
@container swagger-ui (max-height: $height) {
116116
@content;
117117
}
118118
}
119119

120120
@mixin breakpoint($class) {
121121
@if $class == tablet {
122-
@media (min-width: 768px) and (max-width: 1024px) {
122+
@container swagger-ui (min-width: 768px) and (max-width: 1024px) {
123123
@content;
124124
}
125125
} @else if $class == mobile {
126-
@media (min-width: 320px) and (max-width: 736px) {
126+
@container swagger-ui (min-width: 320px) and (max-width: 736px) {
127127
@content;
128128
}
129129
} @else if $class == desktop {
130-
@media (min-width: 1400px) {
130+
@container swagger-ui (min-width: 1400px) {
131131
@content;
132132
}
133133
} @else {

src/style/_topbar.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
flex-wrap: wrap;
1212
gap: 10px;
1313
}
14-
@media (max-width: 550px) {
14+
@container swagger-ui (max-width: 550px) {
1515
.topbar-wrapper {
1616
flex-direction: column;
1717
align-items: start;
@@ -97,7 +97,7 @@
9797
@include type.text_headline($topbar-download-url-button-font-color);
9898
}
9999
}
100-
@media (max-width: 550px) {
100+
@container swagger-ui (max-width: 550px) {
101101
.download-url-wrapper {
102102
width: 100%;
103103
}

src/style/main.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
@use "type";
33

44
.swagger-ui {
5+
container-name: swagger-ui;
6+
container-type: inline-size;
7+
58
@include type.text_body();
69
@include meta.load-css("~tachyons-sass/tachyons.scss");
710
@include meta.load-css("mixins");

0 commit comments

Comments
 (0)