Merge branch 'master' into increase-color-accessibility

This commit is contained in:
David Fischer 2018-05-15 15:06:37 -04:00 committed by GitHub
commit ece48667b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 150 additions and 131 deletions

View File

@ -4,6 +4,9 @@ module.exports = function(grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({ grunt.initConfig({
// Read package.json
pkg: grunt.file.readJSON("package.json"),
open : { open : {
dev: { dev: {
path: 'http://localhost:1919' path: 'http://localhost:1919'
@ -46,14 +49,6 @@ module.exports = function(grunt) {
'bower_components/robotoslab-googlefont/RobotoSlab-Regular.ttf'], 'bower_components/robotoslab-googlefont/RobotoSlab-Regular.ttf'],
dest: 'sphinx_rtd_theme/static/fonts/', dest: 'sphinx_rtd_theme/static/fonts/',
filter: 'isFile' filter: 'isFile'
},
{
expand: true,
flatten: true,
src: ['bower_components/inconsolata-googlefont/Inconsolata-Bold.ttf',
'bower_components/inconsolata-googlefont/Inconsolata-Regular.ttf'],
dest: 'sphinx_rtd_theme/static/fonts/',
filter: 'isFile'
} }
] ]
} }
@ -131,6 +126,19 @@ module.exports = function(grunt) {
}] }]
} }
}, },
usebanner: {
dist: {
options: {
position: 'top',
banner: '/* <%= pkg.name %> version <%= pkg.version %> | MIT license */\n' +
'/* Built <%= grunt.template.today("yyyymmdd HH:mm") %> */',
linebreak: true
},
files: {
src: [ 'sphinx_rtd_theme/static/js/theme.js', 'sphinx_rtd_theme/static/css/theme.css' ]
}
}
},
exec: { exec: {
bower_update: { bower_update: {
cmd: 'bower update' cmd: 'bower update'
@ -180,6 +188,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-open'); grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-browserify'); grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask('default', ['exec:bower_update','clean','copy:fonts','sass:dev','browserify:dev','exec:build_sphinx','connect','open','watch']); grunt.registerTask('default', ['exec:bower_update','clean','copy:fonts','sass:dev','browserify:dev','usebanner','exec:build_sphinx','connect','open','watch']);
grunt.registerTask('build', ['exec:bower_update','clean','copy:fonts','sass:build','browserify:build','uglify','exec:build_sphinx']); grunt.registerTask('build', ['exec:bower_update','clean','copy:fonts','sass:build','browserify:build','uglify','usebanner','exec:build_sphinx']);
} }

View File

@ -1,104 +1,102 @@
sphinx_rtd_theme/static/fonts/Inconsolata-Bold.ttf sphinx_rtd_theme/static/fonts/Lato-Bold.ttf
sphinx_rtd_theme/static/fonts/Lato-Bold.ttf sphinx_rtd_theme/static/fonts/Lato-Regular.ttf
sphinx_rtd_theme/static/fonts/Inconsolata.ttf
sphinx_rtd_theme/static/fonts/Lato-Regular.ttf
Copyright (c) <dates>, <Copyright Holder> (<URL|email>),
with Reserved Font Name <Reserved Font Name>.
Copyright (c) <dates>, <Copyright Holder> (<URL|email>), Copyright (c) <dates>, <additional Copyright Holder> (<URL|email>),
with Reserved Font Name <Reserved Font Name>. with Reserved Font Name <additional Reserved Font Name>.
Copyright (c) <dates>, <additional Copyright Holder> (<URL|email>), Copyright (c) <dates>, <additional Copyright Holder> (<URL|email>).
with Reserved Font Name <additional Reserved Font Name>.
Copyright (c) <dates>, <additional Copyright Holder> (<URL|email>). This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
This Font Software is licensed under the SIL Open Font License, Version 1.1. http://scripts.sil.org/OFL
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
----------------------------------------------------------- -----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
----------------------------------------------------------- PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
PREAMBLE development of collaborative font projects, to support the font creation
The goals of the Open Font License (OFL) are to stimulate worldwide efforts of academic and linguistic communities, and to provide a free and
development of collaborative font projects, to support the font creation open framework in which fonts may be shared and improved in partnership
efforts of academic and linguistic communities, and to provide a free and with others.
open framework in which fonts may be shared and improved in partnership
with others. The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
The OFL allows the licensed fonts to be used, studied, modified and fonts, including any derivative works, can be bundled, embedded,
redistributed freely as long as they are not sold by themselves. The redistributed and/or sold with any software provided that any reserved
fonts, including any derivative works, can be bundled, embedded, names are not used by derivative works. The fonts and derivatives,
redistributed and/or sold with any software provided that any reserved however, cannot be released under any other type of license. The
names are not used by derivative works. The fonts and derivatives, requirement for fonts to remain under this license does not apply
however, cannot be released under any other type of license. The to any document created using the fonts or their derivatives.
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives. DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
DEFINITIONS Holder(s) under this license and clearly marked as such. This may
"Font Software" refers to the set of files released by the Copyright include source files, build scripts and documentation.
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation. "Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s). "Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s). "Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
"Modified Version" refers to any derivative made by adding to, deleting, Original Version, by changing formats or by porting the Font Software to a
or substituting -- in part or in whole -- any of the components of the new environment.
Original Version, by changing formats or by porting the Font Software to a
new environment. "Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software. PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
PERMISSION & CONDITIONS a copy of the Font Software, to use, study, copy, merge, embed, modify,
Permission is hereby granted, free of charge, to any person obtaining redistribute, and sell modified and unmodified copies of the Font
a copy of the Font Software, to use, study, copy, merge, embed, modify, Software, subject to the following conditions:
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions: 1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself. 2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
2) Original or Modified Versions of the Font Software may be bundled, contains the above copyright notice and this license. These can be
redistributed and/or sold with any software, provided that each copy included either as stand-alone text files, human-readable headers or
contains the above copyright notice and this license. These can be in the appropriate machine-readable metadata fields within text or
included either as stand-alone text files, human-readable headers or binary files as long as those fields can be easily viewed by the user.
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user. 3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
3) No Modified Version of the Font Software may use the Reserved Font Copyright Holder. This restriction only applies to the primary font name as
Name(s) unless explicit written permission is granted by the corresponding presented to the users.
Copyright Holder. This restriction only applies to the primary font name as
presented to the users. 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Modified Version, except to acknowledge the contribution(s) of the
Software shall not be used to promote, endorse or advertise any Copyright Holder(s) and the Author(s) or with their explicit written
Modified Version, except to acknowledge the contribution(s) of the permission.
Copyright Holder(s) and the Author(s) or with their explicit written
permission. 5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
5) The Font Software, modified or unmodified, in part or in whole, distributed under any other license. The requirement for fonts to
must be distributed entirely under this license, and must not be remain under this license does not apply to any document created
distributed under any other license. The requirement for fonts to using the Font Software.
remain under this license does not apply to any document created
using the Font Software. TERMINATION
This license becomes null and void if any of the above conditions are
TERMINATION not met.
This license becomes null and void if any of the above conditions are
not met. DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
DISCLAIMER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING OTHER DEALINGS IN THE FONT SOFTWARE.
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@ -31,7 +31,6 @@
"dependencies": { "dependencies": {
"lato-googlefont": "*", "lato-googlefont": "*",
"robotoslab-googlefont": "*", "robotoslab-googlefont": "*",
"inconsolata-googlefont": "*",
"font-awesome": "~4.7" "font-awesome": "~4.7"
}, },
"resolutions": { "resolutions": {

View File

@ -6,11 +6,20 @@ Changelog
Master Master
====== ======
New Features
-------------
Fixes Fixes
----- -----
* Color accessibility improvements on the left navigation * Color accessibility improvements on the left navigation
Other Changes
--------------
* Write theme version and build date at top of JavaScript and CSS
* Changed code and literals to use a native font stack (#612)
* Fix small styling issues
v0.3.1 v0.3.1
====== ======

View File

@ -7,6 +7,7 @@
"browserify": "^13.0.0", "browserify": "^13.0.0",
"connect-livereload": "~0.6.0", "connect-livereload": "~0.6.0",
"grunt": "~1.0.1", "grunt": "~1.0.1",
"grunt-banner": "^0.6.0",
"grunt-browserify": "^5.0.0", "grunt-browserify": "^5.0.0",
"grunt-contrib-clean": "^1.0.0", "grunt-contrib-clean": "^1.0.0",
"grunt-contrib-connect": "^1.0.2", "grunt-contrib-connect": "^1.0.2",

View File

@ -1,15 +1,3 @@
@font-face
font-family: 'Inconsolata'
font-style: normal
font-weight: 400
src: local('Inconsolata'), local('Inconsolata-Regular'), url(../fonts/Inconsolata-Regular.ttf) format('truetype')
@font-face
font-family: 'Inconsolata'
font-style: normal
font-weight: 700
src: local('Inconsolata Bold'), local('Inconsolata-Bold'), url(../fonts/Inconsolata-Bold.ttf) format('truetype')
@font-face @font-face
font-family: 'Lato' font-family: 'Lato'
font-style: normal font-style: normal

View File

@ -53,13 +53,20 @@
line-height: $base-line-height line-height: $base-line-height
margin-bottom: $base-line-height margin-bottom: $base-line-height
pre.literal-block
white-space: pre
margin: 0
padding: $base-line-height / 2 $base-line-height / 2
font-family: $code-font-family
display: block
overflow: auto
pre.literal-block, div[class^='highlight'] pre.literal-block, div[class^='highlight']
border: 1px solid $table-border-color border: 1px solid $table-border-color
padding: 0px
overflow-x: auto overflow-x: auto
// 1px hack otherwise border won't show. lame // 1px hack otherwise border won't show. lame
margin: 1px 0 $base-line-height 0 margin: 1px 0 $base-line-height 0
div[class^='highlight'] div[class^='highlight']
padding: 0px
border: none border: none
margin: 0 margin: 0
// Needs 100% width for line highlighting to work properly // Needs 100% width for line highlighting to work properly
@ -76,7 +83,6 @@
white-space: pre white-space: pre
margin: 0 margin: 0
padding: $base-line-height / 2 $base-line-height / 2 padding: $base-line-height / 2 $base-line-height / 2
font-family: $code-font-family
display: block display: block
overflow: auto overflow: auto
& .hll & .hll
@ -85,6 +91,7 @@
margin: 0 -1 * $base-line-height / 2 margin: 0 -1 * $base-line-height / 2
padding: 0 $base-line-height / 2 padding: 0 $base-line-height / 2
pre.literal-block, div[class^='highlight'] pre, .linenodiv pre pre.literal-block, div[class^='highlight'] pre, .linenodiv pre
font-family: $code-font-family
font-size: 12px font-size: 12px
line-height: normal line-height: normal
@ -132,6 +139,7 @@
.line-block .line-block
margin-left: 0px margin-left: 0px
margin-bottom: $base-line-height margin-bottom: $base-line-height
line-height: $base-line-height
.line-block .line-block .line-block .line-block
margin-left: $base-line-height margin-left: $base-line-height
margin-bottom: 0px margin-bottom: 0px
@ -246,6 +254,9 @@
border-color: $table-border-color border-color: $table-border-color
&:not(.field-list) &:not(.field-list)
@extend .wy-table-striped @extend .wy-table-striped
// Remove bottom margin for the last element (and it's last child)
td .last, td .last :last-child
margin-bottom: 0
// This table is what gets spit out for auto-generated API stuff. I style it smaller bits of padding. // This table is what gets spit out for auto-generated API stuff. I style it smaller bits of padding.
table.field-list table.field-list
@extend .wy-table @extend .wy-table
@ -265,6 +276,7 @@
tt, code tt, code
@extend code @extend code
color: $black color: $black
font-family: $code-font-family
padding: 2px 5px padding: 2px 5px
big, em big, em
font-size: 100% !important font-size: 100% !important
@ -275,6 +287,8 @@
&.xref, a & &.xref, a &
font-weight: bold font-weight: bold
color: $text-codexref-color color: $text-codexref-color
pre, kbd, samp
font-family: $code-font-family
// If the literal is inside an a tag, let's color it like a link // If the literal is inside an a tag, let's color it like a link
a tt, a code a tt, a code
color: $link-color color: $link-color
@ -282,12 +296,14 @@
margin-bottom: $base-line-height margin-bottom: $base-line-height
dt dt
font-weight: bold font-weight: bold
margin-bottom: $base-line-height / 2
// Most of the content within these dls are one liners, so I halve the normal margins. // Most of the content within these dls are one liners, so I halve the normal margins.
p, table, ul, ol p, table, ul, ol
margin-bottom: $base-line-height / 2 !important margin-bottom: $base-line-height / 2 !important
// rST seems to want dds to be treated as the browser would, indented. // rST seems to want dds to be treated as the browser would, indented.
dd dd
margin: 0 0 $base-line-height / 2 $base-line-height margin: 0 0 $base-line-height / 2 $base-line-height
line-height: $base-line-height
// This is what Sphinx spits out for it's autodocs. Depending upon what language the person is referencing // This is what Sphinx spits out for it's autodocs. Depending upon what language the person is referencing
// these things usually have a class of "method" or "class" or something similar, but really who knows. // these things usually have a class of "method" or "class" or something similar, but really who knows.
// Sphinx doesn't give me a generic class on these, so unfortunately I have to apply it to the root dl. // Sphinx doesn't give me a generic class on these, so unfortunately I have to apply it to the root dl.

View File

@ -63,4 +63,4 @@ $highlight-color: $yellow
$base-font-family: "Lato", "proxima-nova", "Helvetica Neue", Arial, sans-serif $base-font-family: "Lato", "proxima-nova", "Helvetica Neue", Arial, sans-serif
$custom-font-family: "Roboto Slab", "ff-tisa-web-pro", "Georgia", Arial, sans-serif $custom-font-family: "Roboto Slab", "ff-tisa-web-pro", "Georgia", Arial, sans-serif
$custom-font-family2: Georgia, serif $custom-font-family2: Georgia, serif
$code-font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace $code-font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace