dof-dss / nicsdru_nidirect_theme
Drupal theme for nidirect website
Installs: 8 385
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 7
Forks: 1
Language:Twig
Type:drupal-custom-theme
Requires
- php: >=7.0
- dev-development
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.5-alpha
- 2.1.4-alpha
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.15.2
- 0.15.1
- 0.14.8
- 0.14.7
- 0.14.6
- 0.14.5
- 0.14.4
- 0.14.3
- 0.14.2
- 0.14.1
- 0.12.8
- 0.12.7
- 0.12.6
- 0.12.5
- 0.12.4
- 0.12.3
- 0.12.2
- 0.12.1
- 0.11.20
- 0.11.19
- 0.11.18
- 0.11.17
- 0.11.16
- 0.11.15
- 0.11.14
- 0.11.13
- 0.11.12
- 0.11.11
- 0.11.10
- 0.11.9
- 0.11.8
- 0.11.7
- 0.11.6
- 0.11.5
- 0.11.4
- 0.11.3
- 0.11.2
- 0.11.1
- 0.10.2
- 0.10.1
- 0.9.3
- 0.4.1
- 0.4.0
- 0.3.1
- 0.3.0
- 0.2.13
- 0.2.12
- 0.2.11
- 0.2.10
- 0.2.9
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-main
- dev-dependabot/npm_and_yarn/flat-and-nightwatch-5.0.2
- dev-dependabot/npm_and_yarn/follow-redirects-1.15.2
- dev-dependabot/npm_and_yarn/qs-6.5.3
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/json5-1.0.2
- dev-dependabot/npm_and_yarn/postcss-and-postcss-assets-8.4.21
- dev-dependabot/npm_and_yarn/ansi-regex-and-ansi-regex-5.0.1
- dev-dependabot/npm_and_yarn/async-2.6.4
- dev-dependabot/npm_and_yarn/ejs-3.1.8
- dev-dependabot/npm_and_yarn/vm2-3.9.14
- dev-uat
- dev-bugfix-missing-image-preprocess
- dev-a11y-gp-practices
- dev-a11y-fixes-deux
- dev-footer-links-wrap-fix
- dev-safari-search-suggestions-fix
- dev-misc-fixes
- dev-news-features-fix
- dev-homepage-top-features
- dev-D8NID-594-driving-instructors
- dev-card-image-margin-quickfix
- dev-a11y-fixes-regions
- dev-revert-197-D8NID-1002
- dev-quick-fixes
- dev-D8NID-821
- dev-D8NID-821-b
- dev-D8NID-776-strong-fix
- dev-toc-tweaks
- dev-D8NID-542-tweaks
- dev-table-style-tweaks
- dev-D8NID-654-home-layout-fixes
- dev-D8NID-680
- dev-D8NID-655-header-search-input-width-issue
- dev-D8NID-606-resp-img-styles
- dev-D8NID-650
- dev-D8NID-566-summary-field-theming
- dev-D8NID-658
- dev-Sneaky-tweaks
- dev-D8NID-615-604-address-blockquote
- dev-D8NID-660
- dev-D8NID-646-moderation-sidebar-tweaks
- dev-D8NID-648
- dev-D8NID-607
- dev-D8NID-593
- dev-D8NID-633
- dev-D8NID-542
- dev-D8NID-548-part2
- dev-d8nid-565
- dev-D8NID-420
- dev-D8NID-541-bug-fix
- dev-d8nid-423
- dev-d8nid-535
- dev-D8NID-491
- dev-D8NID-514
- dev-D8NID-412
- dev-D8NID-461
- dev-D8NID-193
- dev-circle_ci_php7.3
- dev-D8NID-188-news-listing
- dev-omahm-patch-1
- dev-D8NID-398
- dev-D8NID-290-social-sharing-links
- dev-D8NID-87
This package is auto-updated.
Last update: 2023-10-22 14:00:25 UTC
README
DEPRECATED
This theme has been merged into the main repo. Any changes to this repo will not appear on the site.
nicsdru_nidirect_theme
This repository contains code for nidirect Drupal 8 site theme.
Table of contents
- Quick start
- What's included
- Bugs and feature requests
- Using the NPM scripts
- Theme hooks
- Helpers
- Sub-theming
- Documentation
Quick start
composer config repositories.repo-name vcs git@github.com:dof-dss/nicsdru_nidirect_theme.git
composer require dof-dss/nicsdru_nidirect_theme:dev-
- in terminal cd to the directory (
[DRUPAL_ROOT]/themes/custom/nicsdru_nidirect_theme
) and runnpm install
What's included
The kit uses NPM scripts and packages to create tooling to:
- write and compile scss to css
- apply appropriate prefixing for css rules
- write and uglify js
- detect features the user’s browser has to offer (via Modernizr)
- code linting
- optimise and compress images for the web
- living style guide for the code via kss
Within the download you'll find the following directories and files, logically grouping common assets, you'll see something like this:
nicsdru_origins_theme/
└── config/
└── css/
└── docs/
└── inc/
└── js/
└── src/
│ ├── images/
│ ├── js/
│ ├── scss/
│ ├── styleguide/
└── templates/
└── .gitignore
└── composer.json
└── mkdocs.yml
└── nicsdru_nidirect_theme.breakpoints.yml
└── nicsdru_nidirect_theme.info.yml
└── nicsdru_nidirect_theme.layouts.yml
└── nicsdru_nidirect_theme.libraries.yml
└── nicsdru_nidirect_theme.theme
└── package.json
└── README.md
└── screenshot.png
Using the NPM scripts
The package.json
includes the following commands and tasks:
Task | Description |
---|---|
npm run build |
npm run build compiles files into their build directories ready for use in a production environment. Uses Sass, Autoprefixer, Modernizr and UglifyJS. |
npm run watch |
Watches for changes to scss and js files & compiles them for development purposes. |
npm run lint |
Will run all .scss and .js files through their respective linting tools - eslint & sass-lint |
npm run lint-scss |
Will run all .scss files through sass-lint. The command can also accept a parameter to lint an individual file. To do this npm run lint-scss -- scssfile:name-of-file where name-of-file is the file you want to lint relative to the package.json for the project. |
Run npm run
to see all the npm scripts.
Theme hooks
Common theme hooks such as hook_preprocess, hook_alter should not be added to
the .theme
file but to their respective include file under the /inc directory
There are currently hook files for:
- alter
- preprocess
- process
- theme
Utility classes
The src/LayoutClasses.php class provides static constants for commonly used CSS class groups.
The src/Helpers.php class includes commonly reused or helpful functions. The 'blockContent' method will load a block and return the viewBuilder render array.
Documentation
Page title handling
Drupal normally adds the label or title variable to the page.twig.html
template, and where this needs to appear in
a separate location for other content variants it requires the use of a secondary template variable + preprocessing
to show/hide the correct value.
Drupal 8 introduces a page title block that is rendered in a given template with the {{ drupal_block('page_title_block', wrapper=false) }}
Twig extension to render Drupal blocks in-situ. This approach offers maximum flexibility and moves any conditional
logic from preprocess hooks into the block configuration itself.