Skip to content

Commit cea3b9b

Browse files
robcresswellsdras
authored andcommitted
Improve text accessibility (vuejs#1666)
This patch makes a few changes: - Alter the "light" text colour so that it is WCAG AAA compliant for legibility. - Adjust code colours to be at least WCAG AA compliant. - Darken the "medium" and "dark" colours, so as to preserve significance of different shades - Make text use the font-size set by the browser so users with visual impairment can choose their own size, rather than hardcoding 15px and forcing people to zoom. Most browsers default to 16px, in my understanding. Also adjust the max-width of the body, to account for the increased font-size and prevent aggressive line wrapping. - Adjust some of the site meta tags to allow scaling on mobile
1 parent 7e5451f commit cea3b9b

File tree

6 files changed

+14
-18
lines changed

6 files changed

+14
-18
lines changed

themes/vue/layout/layout.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title><%- page.title ? page.title + '' : '' %>Vue.js</title>
77
<meta charset="utf-8">
88
<meta name="description" content="<%- theme.site_description %>">
9-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
9+
<meta name="viewport" content="width=device-width, initial-scale=1">
1010

1111
<link rel="alternate" hreflang="x-default" href="https://vuejs.org/<%- page.path %>">
1212
<link rel="alternate" hreflang="zh" href="https://cn.vuejs.org/<%- page.path %>">

themes/vue/source/css/_common.styl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ code, pre
3636
-moz-osx-font-smoothing: initial
3737

3838
code
39-
color: #e96900
39+
color: #d63200
4040
padding: 3px 5px
4141
margin: 0 2px
4242
border-radius: 2px
@@ -129,7 +129,6 @@ input.button
129129
border-top: 1px solid #eee
130130
a
131131
color: lighten($dark, 10%)
132-
font-size: .9em
133132
display: block
134133
&:hover
135134
color: $green
@@ -143,7 +142,7 @@ input.button
143142
height: 0
144143
border-left: 4px solid transparent
145144
border-right: 4px solid transparent
146-
border-top: 5px solid #ccc
145+
border-top: 5px solid $light
147146

148147
sup.beta.beta
149148
font-size: .6em

themes/vue/source/css/_settings.styl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ $logo-font = "Dosis", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif
44
$code-font = "Roboto Mono", Monaco, courier, monospace
55

66
// font sizes
7-
$body-font-size = 16px
8-
$code-font-size = .8em
7+
$body-font-size = 1rem
8+
$code-font-size = .85rem
99

1010
// colors
11-
$dark = #2c3e50
12-
$medium = #34495e
13-
$light = #7f8c8d
11+
$dark = #273849
12+
$medium = #304455
13+
$light = #4f5959
1414
$green = #42b983
1515
$border = #dddddd
1616
$codebg = #f8f8f8

themes/vue/source/css/_sidebar.styl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
margin-left: 5px
2828
.menu-root
2929
padding-left: 0
30-
.menu-sub
31-
font-size: .85em
3230
.sidebar-link
3331
color: $light
3432
&.current
@@ -92,4 +90,4 @@
9290

9391
@media print
9492
.sidebar
95-
display: none
93+
display: none

themes/vue/source/css/_syntax.styl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ pre code
77
color: #525252
88
white-space: pre
99
padding: 1.2em 1.4em
10-
line-height: 1.5em
11-
font-size: 1em
10+
font-size: 0.9rem;
11+
line-height: 1.6rem
1212
display: block
1313

1414
.hljs
@@ -55,7 +55,7 @@ pre code
5555

5656
&-keyword,
5757
&-attribute
58-
color: #e96900
58+
color: #d63200
5959

6060
&-number,
6161
&-literal
@@ -78,7 +78,7 @@ pre code
7878
&-shebang,
7979
&-apache &-sqbracket,
8080
&-tex &-formula
81-
color: #b3b3b3
81+
color: #707070
8282

8383
&-coffeescript &-javascript,
8484
&-javascript &-xml,

themes/vue/source/css/page.styl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
.content
2424
position: relative
2525
padding: 2.2em 0
26-
max-width: 600px
26+
max-width: 700px
2727
margin: 0 auto
2828
padding-left: 50px
2929
&.api
@@ -186,7 +186,6 @@
186186
margin-top: 2em
187187
padding-top: 2em
188188
border-top: 1px solid #e5e5e5
189-
font-size: .9em
190189

191190
#main.fix-sidebar
192191
position: static

0 commit comments

Comments
 (0)