Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nr/feat/safer travel #318

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/contributing/application-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

- `js/`

Any javascript files located in here will be concatenated and compiled into `docs/js/wmcads-vendor.min.js` via the [javascript build task](tasks.md#markdown-header-141-scripts-javascript).
Any javascript files located in here will be concatenated and compiled into `docs/js/ds-vendor.min.js` via the [javascript build task](tasks.md#markdown-header-141-scripts-javascript).

- `build/` **contains auto-generated files**

Expand Down
4 changes: 2 additions & 2 deletions doc/contributing/coding-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Find components in `src/wmcads/components`.

Components must use the `.wmcads-` namespace.
Components must use the `.ds-` namespace.

For example, `.wmcads-button`.
For example, `.ds-button`.

## Writing CSS for components

Expand Down
38 changes: 19 additions & 19 deletions doc/contributing/css.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## `wmca` namespacing

All class names start with a `.wmcads-` namespace to reduce the likelihood of
All class names start with a `.ds-` namespace to reduce the likelihood of
conflicting with existing classes in your application. It also helps to identify
where the styling for a particular element is coming from.

Expand All @@ -24,9 +24,9 @@ The naming convention follows this pattern:
.block__element {}
.block--modifier {}

.wmcads-card // Block - the root of a component
.wmcads-card__body // Element - a part of the block
.wmcads-card--active // Modifier - a variant of the block
.ds-card // Block - the root of a component
.ds-card__body // Element - a part of the block
.ds-card--active // Modifier - a variant of the block
```

It uses double hyphens (`--`) and underscores (`__`) so that the block, element
Expand All @@ -35,9 +35,9 @@ or modifiers themselves can be hyphen delimited without causing ambiguity.
For example:

```scss
.wmcads-phase-banner
.wmcads-phase-banner__phase-tag
.wmcads-phase-banner__phase-tag--light-blue
.ds-phase-banner
.ds-phase-banner__phase-tag
.ds-phase-banner__phase-tag--light-blue
```

### Further reading:
Expand All @@ -57,7 +57,7 @@ given class name. It also discourages excessive nesting.
Bad:

```
.wmcads-breadcrumb {
.ds-breadcrumb {
...
&__item {
...
Expand All @@ -68,11 +68,11 @@ Bad:
Good:

```
.wmcads-breadcrumb {
.ds-breadcrumb {
...
}

.wmcads-breadcrumb__item {
.ds-breadcrumb__item {
...
}
```
Expand All @@ -98,11 +98,11 @@ other components.

Keep all of the variants of a component in the same place.

`.wmcads-error-summary` modifies the `.wmcads-list` component.
`.ds-error-summary` modifies the `.ds-list` component.

Component modifiers use an extra class, scoped to the component:

`.wmcads-error-summary__list`
`.ds-error-summary__list`

This class is part of the component, rather than a parent of a component.

Expand Down Expand Up @@ -165,7 +165,7 @@ Good:

```
.selector {
color: $wmcads-blue;
color: $ds-blue;
}
```

Expand Down Expand Up @@ -214,7 +214,7 @@ Bad:
Good:

```
.wmcads-wrapper {
.ds-wrapper {
...
}
```
Expand Down Expand Up @@ -256,7 +256,7 @@ a {
Bad:

```
.wmcads-breadcrumb {
.ds-breadcrumb {
...
&__item {
...
Expand All @@ -267,11 +267,11 @@ Bad:
Good:

```
.wmcads-breadcrumb {
.ds-breadcrumb {
...
}

.wmcads-breadcrumb__item {
.ds-breadcrumb__item {
...
}
```
Expand Down Expand Up @@ -420,15 +420,15 @@ Bad:

```
@mixin FONT_STACK() {
font-family: $wmcads-font-stack;
font-family: $ds-font-stack;
}
```

Good:

```
@mixin font-stack() {
font-family: $wmcads-font-stack;
font-family: $ds-font-stack;
}
```

Expand Down
2 changes: 1 addition & 1 deletion doc/contributing/nunjucks-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Find out more about the [Nunjucks templating language](https://github.com/mozill
{% macro wmcadsComponentName(params) %}
{# Component description/ comments here #}

<div class="wmcads-componentName">
<div class="ds-componentName">

</div>

Expand Down
8 changes: 4 additions & 4 deletions doc/contributing/tasks/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ Build commands are used for when code is to be compiled to an output that is sui
- Uses [autoprefixer](https://www.npmjs.com/package/gulp-autoprefixer) to parse CSS and add vendor prefixes
- Minifies CSS
- Creates two files in `{root}/doc/css/`
- `wmcads-website.min.css`
- `ds-website.min.css`
- For styleguide specific styling
- `wmcads-components.min.css`
- `ds-components.min.css`
- For any styling related to WMRE components
- Creates sourcemaps in `{route}/_sourcemaps/`

Expand Down Expand Up @@ -74,8 +74,8 @@ Build commands are used for when code is to be compiled to an output that is sui
- Concatenates all smaller javascript files together into one file
- Mangles and minifies the file
- Creates three files in `{root}/doc/js/`
- `wmcads-website.min.js`
- Created from any javascript files found in `{root}/src/wmcads-website/**/*.js`
- `ds-website.min.js`
- Created from any javascript files found in `{root}/src/ds-website/**/*.js`
- For styleguide specific items only
- `vendor.min.js`
- Created from any javascript files found in `{root}/src/assets/js/vendor/**/*.js`
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/browser-sync.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Local requires
const browserSync = require('browser-sync').create();
const paths = require('./paths.js'); // List of all paths in a config
const paths = require('./paths'); // List of all paths in a config

const startingBrowserSync = () => {
return browserSync.init({
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/build-nunjucks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const fs = require('fs');
const babel = require('@babel/standalone');
const DOMPurify = require('dompurify');
// Gulp requires
Expand All @@ -7,7 +8,6 @@ const beautify = require('js-beautify').html;
const beautifyJS = require('js-beautify');

// Local requires
const fs = require('fs');
const markdown = require('nunjucks-markdown');
const marked = require('marked');
const paths = require('./paths');
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/cache-bust.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const { src, dest } = require('gulp');
const plugins = require('gulp-load-plugins')();
// Local requires
const paths = require('./paths.js');
const paths = require('./paths');

const bustingCache = () => {
const cbString = new Date().getTime();
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/clean.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const del = require('del');
const paths = require('./paths.js');
const paths = require('./paths');

const cleaningDir = () => {
return del([paths.output, paths.logs.sourcemaps, paths.clean.a11y, paths.clean.tmp]);
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/lint-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const { src } = require('gulp');
const plugins = require('gulp-load-plugins')();
// Local requires
const paths = require('./paths.js');
const paths = require('./paths');

const lintingStyles = () => {
return src(paths.styles.src)
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/lint-templates.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Gulp requires
const { src } = require('gulp');
const plugins = require('gulp-load-plugins')();
const paths = require('./paths.js');
const paths = require('./paths');

const lintingTemplates = () => {
return src(`${paths.nunjucks.output}**/*.html`)
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/min-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const { src, dest } = require('gulp');
const plugins = require('gulp-load-plugins')();
// Local requires
const paths = require('./paths.js');
const paths = require('./paths');

const minifyingImages = () => {
return src(paths.images.src)
Expand Down
23 changes: 0 additions & 23 deletions gulp-tasks/move-old-files.js

This file was deleted.

15 changes: 9 additions & 6 deletions gulp-tasks/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ module.exports = {
src: ['src/**/*.scss'], // src of styles to watch
minifySrc: [
'src/wmcads/assets/sass/wmcads.scss',
'src/www/wmcads-website.scss',
'src/wmcads/assets/sass/tfwmds.scss',
'src/wmcads/assets/sass/stds.scss',
'src/wmcads/assets/sass/mcds.scss',
'src/www/ds-website.scss',
'src/www/pages/templates/templates.scss',
'src/wmcads/assets/sass/wmcads-grid/grid.scss',
'src/wmcads/assets/sass/ds-grid/grid.scss',
'src/wmcads/assets/sass/split/buttons.scss',
'src/wmcads/assets/sass/split/accordion.scss',
'src/wmcads/assets/sass/split/typography.scss',
Expand All @@ -26,13 +29,13 @@ module.exports = {
// List of JS folders to concatenate, lint and minified to one file (DON'T LINT ASSETS AS IT WILL TAKE TOO LONG TO SCAN MINIFIED LIBS)
minifySrc: [
{
src: 'src/www/wmcads-website.js',
minName: 'wmcads-website.min.js',
src: 'src/www/ds-website.js',
minName: 'ds-website.min.js',
lint: true
},
{
src: 'src/www/wmcads-templates.js',
minName: 'wmcads-templates.min.js',
src: 'src/www/ds-templates.js',
minName: 'ds-templates.min.js',
lint: true
}
],
Expand Down
12 changes: 6 additions & 6 deletions gulp-tasks/sprite-svgs.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Gulp requires
const { src, dest } = require('gulp');
const plugins = require('gulp-load-plugins')();

// Local requires
const path = require('path');
const paths = require('./paths.js');
const path = require('./paths');

const spritingSVGs = () => {
return src(paths.svgs.src)
return src(path.svgs.src)
.pipe(
plugins.rename(file => {
const newName = file;
const name = file.dirname.split(path.sep);
name.push(file.basename);
name.unshift('wmcads');
name.unshift('ds');
newName.basename = name.join('-');
})
)
Expand All @@ -36,8 +36,8 @@ const spritingSVGs = () => {
})
)
.pipe(plugins.svgstore())
.pipe(plugins.rename({ basename: 'wmcads-icons', extname: '.min.svg' }))
.pipe(dest(paths.svgs.dest));
.pipe(plugins.rename({ basename: 'ds-icons', extname: '.min.svg' }))
.pipe(dest(path.svgs.dest));
};

module.exports = spritingSVGs;
9 changes: 2 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { src, dest, watch, series, parallel } = require('gulp');

const paths = require('./gulp-tasks/paths.js'); // List of all paths in a config
const paths = require('./gulp-tasks/paths'); // List of all paths in a config

// STYLES
const lintStyles = require('./gulp-tasks/lint-styles'); // Lint styles
Expand Down Expand Up @@ -31,8 +31,6 @@ const cleanBuild = require('./gulp-tasks/clean'); // Clean the current build & _

const cacheBust = require('./gulp-tasks/cache-bust'); // This function checks index.html for cb=123 and replaces with current dateTime to bust cache

const { moveOldCSS, moveOldReactNative, moveOldIcons } = require('./gulp-tasks/move-old-files');

const { startBrowserSync, reload } = require('./gulp-tasks/browser-sync'); // BrowserSync server

// WATCHERS
Expand Down Expand Up @@ -69,10 +67,7 @@ const buildAll = series(
buildConfig,
lintStyles,
lintTemplates,
lintScripts,
moveOldCSS,
moveOldReactNative,
moveOldIcons
lintScripts
);

// run buildStyles, buildFonts,& minifyJS on start, series so () => run in an order and parallel so () => can run at same time
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "wmcads-design-system",
"name": "ds-design-system",
"version": "1.5.0",
"description": "A library of typography, visual styles and user interface components which are documented for West Midlands Combined Authority.",
"homepage": "https://wmcadigital.github.io/wmca-design-system",
Expand Down
Binary file modified src/wmcads/assets/.DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions src/wmcads/assets/icon/social/facebook-old.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading