Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Commit

Permalink
Update with the latest starterkit from bootstrap 8.x-3.20.
Browse files Browse the repository at this point in the history
Apart from the changes in the starterkit structure, this release also updates the SCSS files themselves from their updated source.
  • Loading branch information
hussainweb committed Aug 15, 2019
1 parent 3cd5b45 commit 409b067
Show file tree
Hide file tree
Showing 25 changed files with 73 additions and 88 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is an example of using webpack in Drupal theme. Specifically, this repository contains the SASS starterkit of the [Drupal Bootstrap](https://www.drupal.org/project/bootstrap) theme. It is modified to work with webpack. The detailed change list is below (to-do).

This starterkit is taken from version [8.x-3.17 of the bootstrap theme](https://www.drupal.org/project/bootstrap/releases/8.x-3.17). I'll try to keep this updated but changes should not be significant.
This starterkit is taken from version [8.x-3.20 of the bootstrap theme](https://www.drupal.org/project/bootstrap/releases/8.x-3.20). I'll try to keep this updated but changes should not be significant.

## Usage

Expand All @@ -25,6 +25,10 @@ $ ./set-theme-name.sh mytheme
4. Start working on your theme. The SCSS files are in `assets/scss` and JavaScript files are in `assets/js` directories. You may modify other directories as you wish.
5. Run `npm run dev` to run webpack in development mode. You may also watch for changes using `npm run watch`. For production mode, run `npm run production`.

### Additional notes

You do not need to follow all the steps from the official [sub-theming guide](https://drupal-bootstrap.org/api/bootstrap/docs!Sub-Theming.md/group/sub_theming/8.x-3.x). This template already takes care of getting the [drupal-bootstrap-styles](https://github.com/unicorn-fail/drupal-bootstrap-styles) and putting them in the correct location for you. You only need to follow the steps above.

## Changes from starterkit

(to-do)
61 changes: 0 additions & 61 deletions README.theme-starterkit.md

This file was deleted.

2 changes: 1 addition & 1 deletion THEMENAME.starterkit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type: theme
base theme: bootstrap

name: 'THEMETITLE'
description: 'Uses the Bootstrap framework Sass source files and must be compiled (not for beginners).'
description: 'A Drupal Bootstrap 3 based sub-theme.'
package: 'Bootstrap'

regions:
Expand Down
37 changes: 37 additions & 0 deletions assets/scss/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# [Drupal Bootstrap Styles] (SASS)

These files are intended to be used within a [Drupal Bootstrap] based sub-theme.

## Default Variables

The `_default-variables.scss` file is generally where you will spend the
majority of your time providing any default variables that should be
used by the [Bootstrap Framework] instead of its own.

> **WARNING:** It is highly recommended that you only put the default variables
you intend to override in this file. Copying and pasting the entire
`_variables.scss` file provided by the [Bootstrap Framework] is redundant and
only makes it more difficult to determine which variable has been overridden
when the need to update or upgrade to newer versions in the future arises.

## Drupal Bootstrap

The `_drupal-bootstrap.scss` file contains various styles to properly integrate
[Drupal Bootstrap] with the [Bootstrap Framework].

## Compiling

The `style.scss` file is the main compiling entry point. It is the glue that
combines: `_default-variables.scss`, [Bootstrap Framework Source Files] and the
`_drupal-bootstrap.scss` files together. Generally, you will not need to modify
this file unless you need to add or remove files to be imported.

Your [Sass] compiler should use this file as it's "source" and its compiled
output "destination" should be `../css/style.css` (overwrites the file provided
by the base-theme starterkit).

[Bootstrap Framework]: https://getbootstrap.com/docs/3.4/
[Bootstrap Framework Source Files]: https://github.com/twbs/bootstrap-sass
[Drupal Bootstrap]: https://www.drupal.org/project/bootstrap
[Drupal Bootstrap Styles]: https://github.com/unicorn-fail/drupal-bootstrap-styles
[Sass]: http://sass-lang.com
33 changes: 15 additions & 18 deletions assets/scss/_overrides.scss → assets/scss/_drupal-bootstrap.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
// @todo these should be their own CSS files and only included when
// specific Drupal libraries are used.
@import "component/alert";
@import "component/ajax";
@import "component/field";
@import "component/file";
@import "component/filter";
@import "component/form";
@import "component/icon";
@import "component/navbar";
@import "component/node";
@import "component/panel";
@import "component/progress-bar";
@import "component/table-drag";
@import "component/tabs";
@import "component/toolbar";
@import "drupal-bootstrap/component/alert";
@import "drupal-bootstrap/component/ajax";
@import "drupal-bootstrap/component/field";
@import "drupal-bootstrap/component/file";
@import "drupal-bootstrap/component/filter";
@import "drupal-bootstrap/component/form";
@import "drupal-bootstrap/component/icon";
@import "drupal-bootstrap/component/navbar";
@import "drupal-bootstrap/component/node";
@import "drupal-bootstrap/component/panel";
@import "drupal-bootstrap/component/progress-bar";
@import "drupal-bootstrap/component/table-drag";
@import "drupal-bootstrap/component/tabs";
@import "drupal-bootstrap/component/toolbar";

// jQuery UI style overrides.
@import "jquery-ui/autocomplete";
@import "drupal-bootstrap/jquery-ui/autocomplete";

ol, ul {
padding-left: 1.5em;
Expand Down Expand Up @@ -57,7 +55,6 @@ p:last-child,
}
}


.help-block, .control-group .help-inline {
color: $gray-light;
font-size: 12px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
// @see https://www.drupal.org/node/2152217
// @see https://www.drupal.org/node/2274631
.form-required:after {
background-image: url('#{$image-path}/required.svg');
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI0VFMDAwMCIgIGQ9Ik0wLDcuNTYybDEuMTE0LTMuNDM4YzIuNTY1LDAuOTA2LDQuNDMsMS42ODgsNS41OSwyLjM1QzYuMzk4LDMuNTUzLDYuMjM3LDEuNTQ0LDYuMjIsMC40NDdoMy41MTEgYy0wLjA1LDEuNTk3LTAuMjM0LDMuNi0wLjU1OCw2LjAwM2MxLjY2NC0wLjgzOCwzLjU2Ni0xLjYxMyw1LjcxNC0yLjMyNUwxNiw3LjU2MmMtMi4wNSwwLjY3OC00LjA2LDEuMTMxLTYuMDI4LDEuMzU2IGMwLjk4NCwwLjg1NiwyLjM3MiwyLjM4MSw0LjE2Niw0LjU3NWwtMi45MDYsMi4wNTljLTAuOTM1LTEuMjc0LTIuMDQxLTMuMDA5LTMuMzE2LTUuMjA2Yy0xLjE5NCwyLjI3NS0yLjI0NCw0LjAxMy0zLjE0Nyw1LjIwNiBsLTIuODU2LTIuMDU5YzEuODcyLTIuMzA3LDMuMjExLTMuODMyLDQuMDE3LTQuNTc1QzMuODQ5LDguNTE2LDEuODcyLDguMDYyLDAsNy41NjIiLz48L3N2Zz4K);
background-size: 10px 7px;
content:"";
display: inline-block;
Expand Down
2 changes: 1 addition & 1 deletion assets/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
@import 'bootstrap';

// Base-theme overrides.
@import 'overrides';
@import 'drupal-bootstrap';
10 changes: 7 additions & 3 deletions config/install/THEMENAME.settings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default settings should not be located here. This file is only used to
# override existing settings. If your theme is the one that introduces a new
# theme setting, it should use the Drupal Bootstrap base theme's
# install initial setting values. If your theme is the one that introduces a
# new theme setting, it should use the Drupal Bootstrap base theme's
# @BootstrapSetting annotation discovery process. This ensures that sub-theme
# settings are inherited from base themes themes properly and to determine when
# a setting should be saved to config as "overridden".
Expand All @@ -11,5 +11,9 @@
# @see \Drupal\bootstrap\Plugin\Form\SystemThemeSettings
# @see \Drupal\bootstrap\ThemeSettings

# This file cannot be empty, so install an initial empty array for "schemas".
# @see https://www.drupal.org/node/2813829
schemas: []

# Disable the CDN provider so compiled source files can be used.
cdn_provider: ''
#cdn_provider: ''
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This directory is used to implement various Bootstrap annotated plugins.

Please refer to the [Plugin System](<!-- @url plugins -->) topic for more info.
5 changes: 3 additions & 2 deletions templates/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Use this directory to override template, theme and \[pre\]process functions.
This directory is used to implement various core, contrib, Bootstrap and custom
templates.

Please refer to the @link registry Theme Registry @endlink topic for more info.
Please refer to the [Templates](<!-- @url templates -->) topic for more info.

0 comments on commit 409b067

Please sign in to comment.