Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[b33eff]: CSS to put text on screen when rotated #2109

Merged
merged 9 commits into from
Dec 14, 2023
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