d10 theme for IA2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
rdrew f6ccce326b git sync 7 days ago
.yarn sync 7 days ago
config 1st 7 days ago
css sync 7 days ago
fonts 1st 7 days ago
images 1st 7 days ago
js git sync 7 days ago
scripts 1st 7 days ago
src 1st 7 days ago
templates 1st 7 days ago
.DS_Store block config 7 days ago
.gitignore 1st 7 days ago
.nvmrc 1st 7 days ago
.php-cs-fixer.cache sync 7 days ago
.php-cs-fixer.dist.php sync 7 days ago
.yarnrc.yml sync 7 days ago
README.md 1st 7 days ago
bs.js 1st 7 days ago
composer.json 1st 7 days ago
deploy.sh 1st 7 days ago
favicon.ico 1st 7 days ago
favicon.ico.old 1st 7 days ago
logo.svg git sync 7 days ago
olivesarchives.breakpoints.yml 1st 7 days ago
olivesarchives.info.yml sync 7 days ago
olivesarchives.libraries.yml 1st 7 days ago
olivesarchives.post_update.php 1st 7 days ago
olivesarchives.theme sync 7 days ago
package.json sync 7 days ago
screenshot.png 1st 7 days ago
theme-settings.php 1st 7 days ago
yarn.lock sync 7 days ago

README.md

Information on cloning Olives/Olivesarchives theme # How to sub-theme Olivesarchives. Technically Olivesarchives does not support sub-theming, in this document I'll walk you through copying a Olivesarchives into a new theme and making changes to the CSS and JavaScript.

Why no sub-theming of Olivesarchives?

Olivesarchives isn't quite stable in Drupal 9. We're still making lots of changes to the markup, which can screw up any CSS overrides that you have in place. Even after reaching stable, we likely won't support sub-theming immediately because of various non-critical technical debt issues that we want to fix.

Steps to copy Olivesarchives into a new theme.

Instead of sub-theming, we're going to copy the core theme into a new theme.

You can do this using manual steps or by using the included script.

Use the provided script to copy the theme

Run the build script.

Note, this is only tested on MacOS, and is heavily reliant on code from Stack Overflow. Contributions are welcome!

  1. Copy this repository into the Drupal's /themes/ directory.
  2. Rename this directory into the your themes name.
  3. Use the terminal to cd into the theme's directory.
  4. run sh ./build.sh to start the process to generate the theme.
  5. Enter the name of the theme when prompted (example: Mytheme).

Manually copy theme and rename files

Copy the theme directory.

  1. Copy the /core/themes/olivesarchives directory into the /themes/ directory.
  2. Rename the files in the new theme.
    1. Change the directory name from olivesarchives to the new theme name (in these example, we'll use coco). So rename the olivesarchives directory to coco (Coco is my dogs name).
    2. Rename the olivesarchives.info.yml file to coco.info.yml
    3. Rename olivesarchives.breakpoints.yml file to coco.breakpoints.yml
    4. Rename olivesarchives.libraries.yml file to coco.libraries.yml
    5. Rename olivesarchives.theme file to coco.theme
    6. Rename all of the olivesarchives config within the theme's config directory to coco. For example, rename block.block.olivesarchives_account_menu.yml to block.block.coco_account_menu.yml. There are a number of files in there to rename.
    7. Rename /src/OlivesarchivesPreRender.php to /src/CocoPreRender.php.
  3. Do a global search and replace for the name. When you search and replace, be case-sensitive
    1. Search and replace Olivesarchives with Coco.
    2. Search and replace olivesarchives with coco.
  4. Within the coco.info.yml file, replace experimental: true with core_version_requirement: ^9.
  5. Move all of the "block" config files (starting with "block") from config/install to config/optional.
  6. Move the core.date_format.coco_medium.info.yml from config/install to config/optional.

Copy the CSS and JavaScript compilation scripts.

Copy all of the files this repository into the new theme. These scripts will enable you to make change in the source files and have them compile down to regular CSS and JS.

The most important files are:

  • package.json file
  • yarn.lock file
  • scripts/ directory - this contains the CSS and JS compilation scripts.

Enable the new theme.

You should now see the new theme listed under appearance > themes. Install the new theme and set it to be the default.

It should look exactly like the default core Olivesarchives theme.

Install Node dependencies.

First make sure you have Node, and Yarn installed.

Then run yarn install to install the dependencies.

Make a change to the CSS styles.

Within the theme you'll notice both regular *.css files and also *.pcss.css files. The files that you want to modify are the *.pcss.css files. These PostCSS files will be made into browser-compatible CSS by running the compilation scripts.

  1. Open up the /css/base/variables.pcss.css.
  2. Change some of the blue color's hex values down near line 132.
  3. To generate the CSS run yarn build:css.

Note you can also watch CSS by running yarn watch:css.

See the scripts section within the package.json file for more commands.

Make a change to the JavaScript.

Similar to CSS, there are two JavaScript files for each file:

  • *.es6.js - These are the files that you will modify. They are written using modern JavaScript.
  • *.js - These are the IE11 compatible JavaScript files generated by running the compilation scripts. Do not directly modify these files.

You compile changes to the JavaScript files by running yarn watch:js and yarn build:js.

How to remove IE11 (and Opera Mini support).

Internet Explorer 11 and Opera Mini do not support CSS Variables (aka CSS Custom properties). This results in making new features (such as dark mode) very hard to implement. To remove support for these browsers.

  1. Remove "last 1 Explorer version", from line 95 in package.json.
  2. Remove "last 1 OperaMini version", from line 99 in package.json.
  3. Search the codebase and remove instances of importing the variables.pcss.css file. Examples:
    1. @import "../base/variables.pcss.css"; from css/components/action-links.pcss.css
    2. @import "../../base/variables.pcss.css"; from css/components/navigation/nav-button-mobile.pcss.css
  4. Run yarn build to regenerate the compiled CSS and JavaScript.