Browse Source

Update some coding standards.

pull/37/head
Ned Zimmerman 7 years ago
parent
commit
ee453a5ca8
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 50
      package.json
  2. 6
      resources/assets/scripts/customizer.js
  3. 18
      resources/assets/scripts/main.js
  4. 72
      resources/assets/styles/components/_forms.scss
  5. 20
      resources/assets/styles/layouts/_footer.scss
  6. 188
      resources/assets/styles/layouts/pages/_catalog.scss
  7. 147
      resources/assets/styles/layouts/pages/_front-page.scss
  8. 984
      yarn.lock

50
package.json

@ -23,53 +23,17 @@
"opera 12"
],
"eslintConfig": {
"root": true,
"extends": "eslint:recommended",
"extends": "humanmade",
"globals": {
"jQuery": true,
"wp": true
},
"env": {
"node": true,
"es6": true,
"amd": true,
"browser": true,
"jquery": true
},
"parserOptions": {
"ecmaFeatures": {
"globalReturn": true,
"generators": false,
"objectLiteralDuplicateProperties": false,
"experimentalObjectRestSpread": true
},
"ecmaVersion": 2017,
"sourceType": "module"
},
"plugins": [
"import"
],
"settings": {
"import/core-modules": [],
"import/ignore": [
"node_modules",
"\\.(coffee|scss|css|less|hbs|svg|json)$"
]
},
"rules": {
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "ignore"
}
]
"jsx-a11y/href-no-hash": 0
}
},
"stylelint": {
"extends": "stylelint-config-standard",
"extends": "stylelint-config-recommended-scss",
"rules": {
"no-empty-source": null
}
@ -81,15 +45,15 @@
"start": "cross-env NODE_ENV=development webpack --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"rmdist": "rimraf dist",
"lint": "npm run -s lint:scripts && npm run -s lint:styles",
"lint:scripts": "eslint \"resources/assets/scripts\"",
"lint:styles": "stylelint \"resources/assets/styles/**/*.scss\"",
"lint:scripts": "node_modules/eslint/bin/eslint.js \"resources/assets/scripts/*.js\"",
"lint:styles": "node_modules/stylelint/bin/stylelint.js \"resources/assets/styles/**/*.scss\" --syntax scss",
"test": "npm run -s lint"
},
"engines": {
"node": ">= 6.9.4"
},
"devDependencies": {
"pressbooks-build-tools": "^0.3.0"
"pressbooks-build-tools": "^0.5.0"
},
"dependencies": {
"aetna": "github:pressbooks/aetna#3a0a323",

6
resources/assets/scripts/customizer.js

@ -1,5 +1,5 @@
import $ from 'jquery';
wp.customize('blogname', (value) => {
value.bind(to => $('.brand').text(to));
});
wp.customize( 'blogname', value => {
value.bind( to => $( '.brand' ).text( to ) );
} );

18
resources/assets/scripts/main.js

@ -8,14 +8,14 @@ import home from './routes/home';
import catalog from './routes/catalog';
/** Populate Router instance with DOM routes */
const routes = new Router({
// All pages
common,
// Home page
home,
// Catalog page
catalog,
});
const routes = new Router( {
// All pages
common,
// Home page
home,
// Catalog page
catalog,
} );
// Load Events
jQuery(document).ready(() => routes.loadEvents());
jQuery( document ).ready( () => routes.loadEvents() );

72
resources/assets/styles/components/_forms.scss

@ -1,3 +1,39 @@
label {
margin-bottom: 1rem;
}
textarea {
height: 7.5em;
resize: none;
}
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
flex-grow: 1;
border-top: 0;
border-right: 0;
border-left: 0;
border-bottom: solid 2px $black;
padding: 0 0 1em;
font-size: 0.875rem;
font-weight: 600;
font-family: $font-family-sans-serif;
background: transparent;
-webkit-appearance: none;
-moz-appearance: none;
&:focus {
outline: none;
border-bottom: solid 2px var(--accent, $brand-accent);
}
}
input[type="submit"] {
cursor: pointer;
}
.form {
width: rem(354);
@ -43,42 +79,6 @@
}
}
label {
margin-bottom: 1rem;
}
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
flex-grow: 1;
border-top: 0;
border-right: 0;
border-left: 0;
border-bottom: solid 2px $black;
padding: 0 0 1em;
font-size: 0.875rem;
font-weight: 600;
font-family: $font-family-sans-serif;
background: transparent;
-webkit-appearance: none;
-moz-appearance: none;
&:focus {
outline: none;
border-bottom: solid 2px var(--accent, $brand-accent);
}
}
textarea {
height: 7.5em;
resize: none;
}
input[type="submit"] {
cursor: pointer;
}
// Contact form
.contact {

20
resources/assets/styles/layouts/_footer.scss

@ -1,3 +1,13 @@
.social-media {
margin-top: 1em;
a {
font-size: rem(32);
margin: 0 0.25em;
transition: all 0.4s;
}
}
.network-footer {
margin-bottom: 0;
padding: 60px 42.5px 40px;
@ -67,16 +77,6 @@
}
}
.social-media {
margin-top: 1em;
a {
font-size: rem(32);
margin: 0 0.25em;
transition: all 0.4s;
}
}
@media (min-width: $medium) {
.network-footer {
display: flex;

188
resources/assets/styles/layouts/pages/_catalog.scss

@ -32,6 +32,100 @@
width: 100%;
}
.book {
display: flex;
flex-direction: column;
justify-content: flex-end;
width: percent(165, 358);
margin: 0 percent(9, 358) rem(8) 0;
height: rem(230);
float: left;
padding: 1.5rem rem(8) rem(26);
border: solid 2px var(--accent, $brand-accent);
background: var(--accent, $brand-accent);
p {
margin: 0;
}
a {
font-family: $font-family-sans-serif;
color: var(--accent-fg, $white);
text-decoration: none;
}
&__subject {
height: rem(44);
font-size: rem(14);
}
&__title {
height: rem(118);
font-size: rem(16);
font-weight: 600;
line-height: (20/16);
}
&__read-more {
font-size: rem(14);
}
}
.catalog-navigation {
display: flex;
flex-direction: row;
justify-content: center;
width: 100%;
margin-top: rem(83);
align-items: baseline;
font-family: $font-family-sans-serif;
a {
color: $black;
&:hover,
&:focus {
color: var(--primary, $brand-primary);
}
}
.previous,
.next {
display: block;
margin: 0 rem(26);
font-family: $font-family-sans-serif;
font-size: rem(16);
svg {
width: rem(16.2);
height: rem(12.5);
margin: 0 rem(6);
path {
fill: var(--primary, $brand-primary);
}
}
}
.pages {
display: inline-block;
border-bottom: solid 2px #ececec;
a,
span {
display: inline-block;
width: rem(41);
padding: rem(8) 0;
font-size: rem(24);
text-align: center;
}
.current {
border-bottom: solid rem(6) var(--primary, $brand-primary);
}
}
}
.filters,
.search,
.sort {
@ -173,100 +267,6 @@
margin: rem(32) 0 0 percent(10.5, 360);
padding: 0;
}
.book {
display: flex;
flex-direction: column;
justify-content: flex-end;
width: percent(165, 358);
margin: 0 percent(9, 358) rem(8) 0;
height: rem(230);
float: left;
padding: 1.5rem rem(8) rem(26);
border: solid 2px var(--accent, $brand-accent);
background: var(--accent, $brand-accent);
p {
margin: 0;
}
a {
font-family: $font-family-sans-serif;
color: var(--accent-fg, $white);
text-decoration: none;
}
&__subject {
height: rem(44);
font-size: rem(14);
}
&__title {
height: rem(118);
font-size: rem(16);
font-weight: 600;
line-height: (20/16);
}
&__read-more {
font-size: rem(14);
}
}
.catalog-navigation {
display: flex;
flex-direction: row;
justify-content: center;
width: 100%;
margin-top: rem(83);
align-items: baseline;
font-family: $font-family-sans-serif;
a {
color: $black;
&:hover,
&:focus {
color: var(--primary, $brand-primary);
}
}
.previous,
.next {
display: block;
margin: 0 rem(26);
font-family: $font-family-sans-serif;
font-size: rem(16);
svg {
width: rem(16.2);
height: rem(12.5);
margin: 0 rem(6);
path {
fill: var(--primary, $brand-primary);
}
}
}
.pages {
display: inline-block;
border-bottom: solid 2px #ececec;
a,
span {
display: inline-block;
width: rem(41);
padding: rem(8) 0;
font-size: rem(24);
text-align: center;
}
.current {
border-bottom: solid rem(6) var(--primary, $brand-primary);
}
}
}
}
@media (min-width: 768px) {

147
resources/assets/styles/layouts/pages/_front-page.scss

@ -17,78 +17,6 @@
}
}
.blocks.blocks-2,
.blocks.blocks-3 {
.widget_text:nth-child(2) {
margin-right: 0.5rem;
margin-left: 0.5rem;
border: solid 2px var(--primary, $brand-primary);
box-shadow: unset;
}
}
.blocks.blocks-4 {
.widget_text:nth-child(2) {
color: var(--accent-fg, $white);
background: var(--accent, $brand-accent);
h3 {
color: var(--accent-fg, $white);
&::before {
background: var(--accent-fg, $white);
}
}
.button {
color: var(--accent-fg, $white);
border-color: var(--accent-fg, $white);
background: transparent;
&:hover,
&:focus {
color: var(--accent, $brand-accent);
background: var(--accent-fg, $white);
}
}
}
.widget_text:nth-child(3) {
margin-top: 2rem;
margin-right: 0.5rem;
margin-left: 0.5rem;
border: solid 2px var(--primary, $brand-primary);
box-shadow: unset;
}
}
.blocks.blocks-2 .widget_text:nth-child(2),
.blocks.blocks-3 .widget_text:nth-child(2),
.blocks.blocks-4 .widget_text:nth-child(3) {
background: transparent;
margin-bottom: rem(400);
&::after {
z-index: -1;
content: "";
display: block;
width: 100vw;
height: rem(444);
background-image: url('../images/banner.jpg');
background-position: center;
background-size: cover;
position: absolute;
top: rem(1410);
left: 0;
}
}
.blocks.blocks-4 .widget_text:nth-child(3) {
&::after {
top: rem(1880);
}
}
.latest-books {
height: auto;
padding: 0 0 rem(154);
@ -198,6 +126,76 @@
text-align: center;
}
}
.blocks.blocks-2,
.blocks.blocks-3 {
.widget_text:nth-child(2) {
margin-right: 0.5rem;
margin-left: 0.5rem;
border: solid 2px var(--primary, $brand-primary);
box-shadow: unset;
}
}
.blocks.blocks-4 {
.widget_text:nth-child(2) {
color: var(--accent-fg, $white);
background: var(--accent, $brand-accent);
h3 {
color: var(--accent-fg, $white);
&::before {
background: var(--accent-fg, $white);
}
}
.button {
color: var(--accent-fg, $white);
border-color: var(--accent-fg, $white);
background: transparent;
&:hover,
&:focus {
color: var(--accent, $brand-accent);
background: var(--accent-fg, $white);
}
}
}
.widget_text:nth-child(3) {
margin-top: 2rem;
margin-right: 0.5rem;
margin-left: 0.5rem;
border: solid 2px var(--primary, $brand-primary);
box-shadow: unset;
&::after {
top: rem(1880);
}
}
}
.blocks.blocks-2 .widget_text:nth-child(2),
.blocks.blocks-3 .widget_text:nth-child(2),
.blocks.blocks-4 .widget_text:nth-child(3) {
background: transparent;
margin-bottom: rem(400);
&::after {
z-index: -1;
content: "";
display: block;
width: 100vw;
height: rem(444);
background-image: url('../images/banner.jpg');
background-position: center;
background-size: cover;
position: absolute;
top: rem(1410);
left: 0;
}
}
}
@media (min-width: $medium) {
@ -228,11 +226,6 @@
.blocks.blocks-4 .widget_text:nth-child(3) {
margin-left: auto;
margin-right: auto;
}
.blocks.blocks-2 .widget_text:nth-child(2),
.blocks.blocks-3 .widget_text:nth-child(2),
.blocks.blocks-4 .widget_text:nth-child(3) {
margin-bottom: rem(119);
&::after {

984
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save