Skip to content

Commit 44e87c5

Browse files
committed
Fix example output
1 parent 33eee67 commit 44e87c5

File tree

8 files changed

+98
-8466
lines changed

8 files changed

+98
-8466
lines changed

_includes/lists/main-list.html

Lines changed: 3 additions & 8458 deletions
Large diffs are not rendered by default.

css/website.css

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ th {
8585
content: attr(data-tooltip);
8686
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
8787
font-size: 0.6rem;
88+
font-weight: 400;
8889
left: 50%;
8990
line-height: 1.2;
9091
opacity: 0;
@@ -797,7 +798,7 @@ html ::selection {
797798

798799
.list {
799800
background: #fff;
800-
padding-bottom: 2rem;
801+
padding-bottom: 3rem;
801802
position: relative; }
802803

803804
.tag {
@@ -989,7 +990,8 @@ html ::selection {
989990
opacity: 0.5;
990991
pointer-events: none;
991992
position: absolute;
992-
right: 100%; }
993+
right: 100%;
994+
top: 0; }
993995
.value-name .tag:hover:before {
994996
transform: translateX(4px) translateY(50%); }
995997

@@ -1131,6 +1133,15 @@ html ::selection {
11311133
.element-name a:hover span {
11321134
color: #3273dc; }
11331135

1136+
.element-description code {
1137+
background: #f2f2f2;
1138+
border-radius: 2px;
1139+
color: #333333;
1140+
font-size: 0.9em;
1141+
padding: 1px 5px 3px;
1142+
position: relative;
1143+
top: -1px; }
1144+
11341145
@media (max-width: 799px) {
11351146
.element-header {
11361147
padding-left: 2rem;
@@ -1170,7 +1181,7 @@ html ::selection {
11701181
overflow: auto;
11711182
padding: 1rem; }
11721183
.example-code pre {
1173-
font-size: 14px;
1184+
font-size: 12px;
11741185
padding: 0; }
11751186

11761187
.example-output {
@@ -1179,14 +1190,46 @@ html ::selection {
11791190
padding: 1rem; }
11801191
.example-output a {
11811192
text-decoration: underline; }
1193+
.example-output h1, .example-output h2, .example-output h3, .example-output h4, .example-output h5, .example-output h6 {
1194+
font-weight: bold;
1195+
line-height: 1.2;
1196+
margin: 1em 0 0.5em; }
1197+
.example-output h1:first-child, .example-output h2:first-child, .example-output h3:first-child, .example-output h4:first-child, .example-output h5:first-child, .example-output h6:first-child {
1198+
margin-top: 0; }
1199+
.example-output h1:last-child, .example-output h2:last-child, .example-output h3:last-child, .example-output h4:last-child, .example-output h5:last-child, .example-output h6:last-child {
1200+
margin-bottom: 0; }
1201+
.example-output h1 {
1202+
font-size: 1.6em; }
1203+
.example-output h2 {
1204+
font-size: 1.4em; }
1205+
.example-output h3 {
1206+
font-size: 1.2em; }
1207+
.example-output p {
1208+
margin: 0.5em 0; }
1209+
.example-output p:first-child {
1210+
margin-top: 0; }
1211+
.example-output p:last-child {
1212+
margin-bottom: 0; }
1213+
.example-output main + aside {
1214+
margin-top: 1em; }
11821215

11831216
@media (max-width: 799px) {
11841217
.example {
11851218
padding: 0 2rem; } }
11861219

11871220
@media (min-width: 800px) {
11881221
.example {
1189-
padding: 0 3rem; } }
1222+
padding: 0 3rem; }
1223+
.example-preview {
1224+
display: flex; }
1225+
.example-output {
1226+
flex-basis: 0;
1227+
flex-grow: 1;
1228+
flex-shrink: 1; }
1229+
.example-code {
1230+
flex-basis: 0;
1231+
flex-grow: 2;
1232+
flex-shrink: 2; } }
11901233

11911234
.modal {
11921235
z-index: 50; }

javascript/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ document.addEventListener('DOMContentLoaded', function() {
187187
});
188188

189189
// Element: Copy to clipboard
190-
var clipboard = new Clipboard('.example-value');
190+
var clipboard = new Clipboard('[data-clipboard-target],[data-clipboard-text]');
191191

192-
Array.prototype.forEach.call(document.querySelectorAll('.example-value'), function($el) {
192+
Array.prototype.forEach.call(document.querySelectorAll('[data-clipboard-target],[data-clipboard-text]'), function($el) {
193193
$el.addEventListener('mouseenter', function(e) {
194194
e.target.classList.remove('is-copied');
195195
});

sass/attribute.sass

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
pointer-events: none
3939
position: absolute
4040
right: 100%
41+
top: 0
4142
&:hover:before
4243
transform: translateX(4px) translateY(50%)
4344

sass/element.sass

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@
5757
span
5858
color: $link
5959

60+
.element-description
61+
code
62+
background: $background
63+
border-radius: 2px
64+
color: $text-strong
65+
font-size: 0.9em
66+
padding: 1px 5px 3px
67+
position: relative
68+
top: -1px
69+
6070
+mobile
6171
.element-header
6272
padding-left: 2rem

sass/elements.sass

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.list
22
background: #fff
3-
padding-bottom: 2rem
3+
padding-bottom: 3rem
44
position: relative
55

66
.tag

sass/example.sass

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
overflow: auto
2323
padding: 1rem
2424
pre
25-
font-size: 14px
25+
font-size: 12px
2626
padding: 0
2727

2828
.example-output
@@ -31,6 +31,28 @@
3131
padding: 1rem
3232
a
3333
text-decoration: underline
34+
h1, h2, h3, h4, h5, h6
35+
font-weight: bold
36+
line-height: 1.2
37+
margin: 1em 0 0.5em
38+
&:first-child
39+
margin-top: 0
40+
&:last-child
41+
margin-bottom: 0
42+
h1
43+
font-size: 1.6em
44+
h2
45+
font-size: 1.4em
46+
h3
47+
font-size: 1.2em
48+
p
49+
margin: 0.5em 0
50+
&:first-child
51+
margin-top: 0
52+
&:last-child
53+
margin-bottom: 0
54+
main + aside
55+
margin-top: 1em
3456

3557
+mobile
3658
.example
@@ -39,3 +61,13 @@
3961
+desktop
4062
.example
4163
padding: 0 3rem
64+
.example-preview
65+
display: flex
66+
.example-output
67+
flex-basis: 0
68+
flex-grow: 1
69+
flex-shrink: 1
70+
.example-code
71+
flex-basis: 0
72+
flex-grow: 2
73+
flex-shrink: 2

sass/tooltip.sass

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
content: attr(data-tooltip)
1111
font-family: $family-primary
1212
font-size: 0.6rem
13+
font-weight: 400
1314
left: 50%
1415
line-height: 1.2
1516
opacity: 0

0 commit comments

Comments
 (0)