Skip to content

Commit

Permalink
Adding meta viewport to make examples look OK on mobile (mdn#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdavidmills authored May 9, 2023
1 parent e79171d commit 9703a3f
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 13 deletions.
3 changes: 2 additions & 1 deletion popover-api/basic-declarative/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Basic declarative popover example</title>
</head>
<body>
Expand Down
3 changes: 2 additions & 1 deletion popover-api/blur-background/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Blur background example</title>
<style>
body {
Expand Down
3 changes: 2 additions & 1 deletion popover-api/multiple-auto/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Multiple auto popovers example</title>
<style>
:popover-open {
Expand Down
6 changes: 4 additions & 2 deletions popover-api/multiple-manual/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Multiple manual popovers example</title>
<style>
:popover-open {
position: absolute;
inset: unset;
top: 40px;
top: 80px;
}

#mypopup-1 {
Expand All @@ -26,6 +27,7 @@
<button popovertarget="mypopup-1" popovertargetaction="hide">
Hide popover #1
</button>
<hr>
<button popovertarget="mypopup-2" popovertargetaction="show">
Show popover #2
</button>
Expand Down
7 changes: 4 additions & 3 deletions popover-api/nested-popovers/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nested popovers example</title>
<style>
body,
Expand All @@ -11,7 +12,7 @@

body [popover] {
border: 1px solid black;
width: 10vw;
width: 120px;
inset: unset;
}

Expand All @@ -21,7 +22,7 @@
}

#subpopover {
left: 10vw;
left: 120px;
top: 86px;
}

Expand Down
5 changes: 3 additions & 2 deletions popover-api/popover-positioning/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Popover positioning example</title>
<style>
:popover-open {
width: 300px;
height: 200px;
position: absolute;
inset: unset;
top: 5px;
bottom: 5px;
right: 5px;
margin: 0;
}
Expand Down
3 changes: 2 additions & 1 deletion popover-api/toast-popovers/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Toast popovers example</title>
<style>
.failure {
Expand Down
11 changes: 9 additions & 2 deletions popover-api/toggle-help-ui/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Toggle help UI example</title>
<style>
:popover-open {
position: absolute;
inset: unset;
top: 5px;
bottom: 5px;
right: 5px;
}

@media all and (max-width: 600px) {
:popover-open {
left: 5px;
}
}
</style>
<script src="index.js" defer></script>
</head>
Expand Down

0 comments on commit 9703a3f

Please sign in to comment.