diff --git a/.gitignore b/.gitignore index bc0f10a6..c6649938 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ bundle.js node_modules css node_modules-2018-11-27 +.idea diff --git a/index.html b/index.html index ec4a7df2..9ec5b587 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - +
diff --git a/package.json b/package.json index f777ea61..70484480 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,8 @@ "watch": "watchify index.js -p livereactload -o bundle.js -dv", "watchServer": "node-supervisor --watch server.js,src server.babel.js", "serve": "PORT=1314 node server.babel.js", + "build-css": "sass ./sass/main.scss ./css/main.css", + "build-css:watch": "sass --watch ./sass/main.scss ./css/main.css", "build": "NODE_ENV=production browserify index.js | uglifyjs -c -m | sed 's|http://localhost:4680|https://search.artsmia.org|'> bundle.js" }, "author": "", @@ -37,6 +39,7 @@ "watchify": "^3.9.0" }, "dependencies": { + "sass": "^1.24.0", "@mapbox/react-click-to-select": "^1.1.1", "babel-polyfill": "^6.23.0", "babel-preset-es2015": "^6.22.0", diff --git a/readme.md b/readme.md index b35ffe75..7eb7a372 100644 --- a/readme.md +++ b/readme.md @@ -7,6 +7,11 @@ To start the server locally, you (1) need passing familiarity with (3) `npm start` should start the webserver and begin to update the javascript bundle. +## Building SCSS/CSS + +To build the css files run `npm run build-css` or alternatively `npm run build-css:watch` to have it watch for changes +and rebuild. + # Companion code It pulls information from many different places: diff --git a/sass/main.scss b/sass/main.scss index 81caf560..65166552 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -44,6 +44,28 @@ a:hover { font-weight: 500; } +a.skip-main { + left:-999px; + position: fixed; + top:auto; + width:1px; + height:1px; + overflow:hidden; + z-index:-999; +} +a.skip-main:focus, a.skip-main:active { + background-color: white; + position:fixed; + left: 50%; + top: 5px; + width: 200px; + height: 23px; + margin: 10px -100px; + padding:5px; + text-align:center; + z-index:999; +} + #search { /*margin: 8px;*/ } @@ -80,12 +102,19 @@ header{ .quilt-wrap a:hover { overflow: visible !important; // z-index: 100; - + img { overflow: visible !important; } } +// The regular focus style with the dotted red outline doesn't look very good on the quilt images. A white solid border +// seems to be more visible and doesn't clash as much with the images. +.quilt-wrap a:focus { + outline: 0; + border: 2px solid white; +} + .logo-container{ background-image: url("../images/MIA_LOGO_MARK.svg"); background-repeat: no-repeat; diff --git a/sass/reset.scss b/sass/reset.scss index c299c744..99a1e40f 100644 --- a/sass/reset.scss +++ b/sass/reset.scss @@ -1,4 +1,10 @@ -/* reset & clearfix */ +/* reset & clearfix + +Modifications have been to Eric Meyer's Reset: + +1. Outline resets have been removed. This is more consistent with artsmia.org website and encourages better accessibility + +*/ .clearfix:after { visibility: hidden; @@ -25,7 +31,6 @@ table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; - outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; @@ -39,10 +44,7 @@ ol, ul { blockquote, q { quotes: none; } -/* remember to define focus styles! */ -:focus { - outline: 0; -} + /* remember to highlight inserts somehow! */ ins { text-decoration: none; @@ -62,4 +64,4 @@ html { } *, *:before, *:after { box-sizing: inherit; -} \ No newline at end of file +} diff --git a/server.js b/server.js index 111dec20..5ef20457 100644 --- a/server.js +++ b/server.js @@ -44,7 +44,7 @@ var html = ({ title, meta, link }, data, body) => { app.use((req, res, next) => { var actingUrl = req.url.replace(/\/(.*)\/$/, '/$1') - const internalIPs = process.env.PRIVILEGED_IP_LIST + const internalIPs = process.env.PRIVILEGED_IP_LIST || ''; var privilegedClientIP = internalIPs.split(' ').indexOf(req.ip) > -1 window.privilegedClientIP = privilegedClientIP // FIXME how to pass this other than as a global? diff --git a/src/app.js b/src/app.js index f42fc565..6a346ab8 100644 --- a/src/app.js +++ b/src/app.js @@ -7,15 +7,19 @@ var {pathSatisfies} = require('ramda') var LiveSearch = require('./live-search') var GlobalNavigation = require('./navigation') var consoleWelcomeMessage = require('./console-welcome-message') +var SkipToMainContentLink = require('./skip-to-main-content-link'); + var App = React.createClass({ render() { var logo = this.makeLogo() - var canonicalURL = "https://collections.artsmia.org"+this.props.path + var path = this.props.path + var canonicalURL = "https://collections.artsmia.org" + path return (