Skip to content

Commit 9703a3f

Browse files
Adding meta viewport to make examples look OK on mobile (mdn#217)
1 parent e79171d commit 9703a3f

File tree

8 files changed

+28
-13
lines changed

8 files changed

+28
-13
lines changed

popover-api/basic-declarative/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
56
<title>Basic declarative popover example</title>
67
</head>
78
<body>

popover-api/blur-background/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
56
<title>Blur background example</title>
67
<style>
78
body {

popover-api/multiple-auto/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
56
<title>Multiple auto popovers example</title>
67
<style>
78
:popover-open {

popover-api/multiple-manual/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
56
<title>Multiple manual popovers example</title>
67
<style>
78
:popover-open {
89
position: absolute;
910
inset: unset;
10-
top: 40px;
11+
top: 80px;
1112
}
1213

1314
#mypopup-1 {
@@ -26,6 +27,7 @@
2627
<button popovertarget="mypopup-1" popovertargetaction="hide">
2728
Hide popover #1
2829
</button>
30+
<hr>
2931
<button popovertarget="mypopup-2" popovertargetaction="show">
3032
Show popover #2
3133
</button>

popover-api/nested-popovers/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
56
<title>Nested popovers example</title>
67
<style>
78
body,
@@ -11,7 +12,7 @@
1112

1213
body [popover] {
1314
border: 1px solid black;
14-
width: 10vw;
15+
width: 120px;
1516
inset: unset;
1617
}
1718

@@ -21,7 +22,7 @@
2122
}
2223

2324
#subpopover {
24-
left: 10vw;
25+
left: 120px;
2526
top: 86px;
2627
}
2728

popover-api/popover-positioning/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
56
<title>Popover positioning example</title>
67
<style>
78
:popover-open {
89
width: 300px;
910
height: 200px;
1011
position: absolute;
1112
inset: unset;
12-
top: 5px;
13+
bottom: 5px;
1314
right: 5px;
1415
margin: 0;
1516
}

popover-api/toast-popovers/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
56
<title>Toast popovers example</title>
67
<style>
78
.failure {

popover-api/toggle-help-ui/index.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
56
<title>Toggle help UI example</title>
67
<style>
78
:popover-open {
89
position: absolute;
910
inset: unset;
10-
top: 5px;
11+
bottom: 5px;
1112
right: 5px;
1213
}
14+
15+
@media all and (max-width: 600px) {
16+
:popover-open {
17+
left: 5px;
18+
}
19+
}
1320
</style>
1421
<script src="index.js" defer></script>
1522
</head>

0 commit comments

Comments
 (0)