Skip to content

Commit

Permalink
Add starter_theme to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
rayestrada committed Feb 9, 2024
1 parent bf588b7 commit 6bf7692
Show file tree
Hide file tree
Showing 12 changed files with 178 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Bixal USWDS Drupal base theme

@TODO document the process to create a new child theme from the starter_theme.
3 changes: 3 additions & 0 deletions starter_theme/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore Theme dist files
node_modules
dist
1 change: 1 addition & 0 deletions starter_theme/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.9.0
39 changes: 39 additions & 0 deletions starter_theme/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Bixal USWDS Drupal theme

@TODO Modify this starter_theme to work with core function to generate theme
https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme#s-custom-starterkit-theme

## Requirements

Node: https://nodejs.org/en/
NVM: https://github.com/nvm-sh/nvm

## Getting started

### Installing the node package dependencies and running a build
```
nvm use
npm install
npm run build
```

## npm commands

### Starting a watch for tracking changes and updating compiled files.

```
npm run dev
```

### Building the assets for deployment
```
npm run build
```

## Resources

- [USWDS](https://designsystem.digital.gov/)
- [Components overview](https://designsystem.digital.gov/components/overview/)
- [Design Tokens](https://designsystem.digital.gov/design-tokens/)
- [Utilities](https://designsystem.digital.gov/utilities/)
- [Settings](https://designsystem.digital.gov/documentation/settings/)
34 changes: 34 additions & 0 deletions starter_theme/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const uswds = require("@uswds/compile");
const {parallel, watch, series, src} = require("gulp");
const gulp = require("gulp");

/**
* USWDS version
*/
// Use version 3.
uswds.settings.version = 3;

/**
* Path settings
* Set as many as you need
* see https://designsystem.digital.gov/documentation/getting-started/developers/phase-two-compile/#step-4-create-path-settings-and-export-compile-functions
*/

uswds.paths.dist.theme = './src/sass';
uswds.paths.src.projectSass = './src/sass';
uswds.paths.dist.css = './dist/css';
uswds.paths.dist.img = './dist/img';
uswds.paths.dist.fonts = './dist/fonts';
uswds.paths.dist.js = './dist/js';

/**
* Exports
* Add as many as you need
*/

// Various compile functions.
exports.default = series(uswds.copyAssets, uswds.compile);
exports.init = uswds.init;
exports.compile = uswds.compile;
exports.update = uswds.updateUswds;
exports.copyAssets = uswds.copyAssets;
16 changes: 16 additions & 0 deletions starter_theme/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "uswds_theme",
"version": "3.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "npx gulp"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@uswds/compile": "^1.0.0",
"@uswds/uswds": "^3.6.1"
}
}
23 changes: 23 additions & 0 deletions starter_theme/src/sass/_uswds-theme-custom-styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* * * * * ==============================
* * * * * ==============================
* * * * * ==============================
* * * * * ==============================
========================================
========================================
========================================
----------------------------------------
USWDS THEME CUSTOM STYLES
----------------------------------------
!! Copy this file to your project's
sass root. Don't edit the version
in node_modules.
----------------------------------------
Custom project SASS goes here.
i.e.
@include u-padding-right('05');
----------------------------------------
*/

@use "uswds-core" as *;
15 changes: 15 additions & 0 deletions starter_theme/src/sass/_uswds-theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
----------------------------------------
USWDS with settings overrides
----------------------------------------
Uncomment the following lines and add a list of changed settings
in the form $setting: value,
----------------------------------------
*/

//
// @use "uswds-core" with (
// $setting: value,
// $setting: value
// );
//
3 changes: 3 additions & 0 deletions starter_theme/src/sass/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@forward "uswds-theme";
@forward "uswds";
@forward "uswds-theme-custom-styles";
16 changes: 16 additions & 0 deletions starter_theme/starter_theme-info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Bixal USWDS Theme
type: theme
description: "Drupal theme for use with USWDS."
core_version_requirement: "^9.4 || ^10"
base theme: bixaluswds

libraries:
- starter_theme/base

regions:
admin: "Admin"
header: "Header"
content: "Content"
sidebar: "Sidebar"
footer: "Footer"
no_region: "Blocks for Twig Tweak, hidden, or other purposes"
13 changes: 13 additions & 0 deletions starter_theme/starter_theme-libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
base:
version: VERSION
dependencies:
- starter_theme/uswds

uswds:
version: VERSION
css:
component:
dist/css/styles.css: {}
js:
dist/js/uswds-init.js: {}
dist/js/uswds.js: {}
13 changes: 13 additions & 0 deletions starter_theme/starter_theme.theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/**
* @file
* Functions to support theme templates.
*/

/**
* Implements hook_preprocess().
*/
function starter_theme_preprocess(&$variables) {
$variables['uswds_img_path'] = '/themes/custom/starter_theme/dist/img';
}

0 comments on commit 6bf7692

Please sign in to comment.