Skip to content

Commit

Permalink
[b33eff]: CSS to put text on screen when rotated (#2109)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
tombrunet and Jym77 authored Dec 14, 2023
1 parent 3b66bab commit 7612976
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions _rules/css-restrict-orientation-b33eff.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ acknowledgments:
authors:
- Audrey Maniez
- Jey Nandakumar
- Tom Brunet
funding:
- WAI-Tools
---
Expand Down Expand Up @@ -160,6 +161,8 @@ A page where CSS [transform](https://www.w3.org/TR/css-transforms/#propdef-trans
@media (orientation: portrait) {
html {
transform: rotate(1.5708rad);
width: min(100vw, 100vh);
height: min(100vw, 100vh);
}
}
</style>
Expand Down Expand Up @@ -203,11 +206,16 @@ This page appears rotated at a slight angle of 2.5 degrees for stylistic purpose
<style>
body {
transform: rotate(2.5deg);
padding: 2rem;
width: min(100vw, 100vh);
height: min(100vw, 100vh);
}
@media (orientation: landscape) {
body {
transform: rotate(92.5deg);
position: absolute;
right: 0px;
}
}
</style>
Expand All @@ -230,6 +238,8 @@ A page where the CSS [rotate](https://www.w3.org/TR/css-transforms-2/#individual
@media (orientation: portrait) {
html {
rotate: 90deg;
width: min(100vw, 100vh);
height: min(100vw, 100vh);
}
}
</style>
Expand Down Expand Up @@ -315,6 +325,9 @@ A page where CSS [transform](https://www.w3.org/TR/css-transforms/#propdef-trans
<style>
body {
transform: rotate(90deg);
width: calc(min(100vw, 100vh) - 2rem);
height: calc(min(100vw, 100vh) - 2rem);
padding: 1rem;
}
</style>
</head>
Expand Down

0 comments on commit 7612976

Please sign in to comment.