Skip to content

Commit 7612976

Browse files
tombrunetJym77
andauthored
[b33eff]: CSS to put text on screen when rotated (#2109)
* CSS to put text on screen when rotated * Add author * Fix Fail 1 and 4 to rotate in a square * space to tab --------- Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com>
1 parent 3b66bab commit 7612976

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

_rules/css-restrict-orientation-b33eff.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ acknowledgments:
1717
authors:
1818
- Audrey Maniez
1919
- Jey Nandakumar
20+
- Tom Brunet
2021
funding:
2122
- WAI-Tools
2223
---
@@ -160,6 +161,8 @@ A page where CSS [transform](https://www.w3.org/TR/css-transforms/#propdef-trans
160161
@media (orientation: portrait) {
161162
html {
162163
transform: rotate(1.5708rad);
164+
width: min(100vw, 100vh);
165+
height: min(100vw, 100vh);
163166
}
164167
}
165168
</style>
@@ -203,11 +206,16 @@ This page appears rotated at a slight angle of 2.5 degrees for stylistic purpose
203206
<style>
204207
body {
205208
transform: rotate(2.5deg);
209+
padding: 2rem;
210+
width: min(100vw, 100vh);
211+
height: min(100vw, 100vh);
206212
}
207213
208214
@media (orientation: landscape) {
209215
body {
210216
transform: rotate(92.5deg);
217+
position: absolute;
218+
right: 0px;
211219
}
212220
}
213221
</style>
@@ -230,6 +238,8 @@ A page where the CSS [rotate](https://www.w3.org/TR/css-transforms-2/#individual
230238
@media (orientation: portrait) {
231239
html {
232240
rotate: 90deg;
241+
width: min(100vw, 100vh);
242+
height: min(100vw, 100vh);
233243
}
234244
}
235245
</style>
@@ -315,6 +325,9 @@ A page where CSS [transform](https://www.w3.org/TR/css-transforms/#propdef-trans
315325
<style>
316326
body {
317327
transform: rotate(90deg);
328+
width: calc(min(100vw, 100vh) - 2rem);
329+
height: calc(min(100vw, 100vh) - 2rem);
330+
padding: 1rem;
318331
}
319332
</style>
320333
</head>

0 commit comments

Comments
 (0)