Skip to content

Commit

Permalink
Merge branch '8.x-1.x' into is-page-layout
Browse files Browse the repository at this point in the history
# Conflicts:
#	css/style.css
  • Loading branch information
kybersoft committed Apr 26, 2020
2 parents 94c4e65 + 39e3795 commit e82e925
Show file tree
Hide file tree
Showing 76 changed files with 4,499 additions and 3,769 deletions.
38 changes: 38 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: 2
jobs:
build:
docker:
- image: quay.io/govcms/govcms-ci
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "composer.json" }}
- v1-dependencies-

- run: composer install --no-interaction --prefer-dist
- run: composer lint

- run: npm run setup
- run: npm run js-lint
- run: npm run gulp
- run: npm run styleguide

- run:
name: Assert the compiled assets were committed to the repository.
command: git --no-pager diff --exit-code css js styleguide

- run:
name: Store generated styleguide
command: mkdir -p /tmp/artifacts && cp -r css js styleguide /tmp/artifacts/
when: always
- store_artifacts:
path: /tmp/artifacts
when: always

- save_cache:
paths:
- node_modules
- vendor
key: v1-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "composer.json" }}
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[*.js]
indent_size = 2

[composer.{json,lock}]
indent_size = 4

[*.{yml,yaml}]
indent_size = 2

[*.{sh,bash,bats}]
indent_size = 2

[*.{xml}]
indent_size = 4
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore files for distribution archives.
.circleci export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
assets/uikit
node_modules
vendor
composer.lock
113 changes: 113 additions & 0 deletions .tugboat/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
services:
php:
# Use PHP 7.2 with Apache to serve the Drupal site
image: tugboatqa/php:7.3-apache

# Set this as the default service. This does a few things
# 1. Clones the git repository into the service container
# 2. Exposes port 80 to the Tugboat HTTP proxy
# 3. Routes requests to the preview URL to this service
default: true

# Wait until the mysql service is done building
depends: mysql

visualdiffs:
:default:
- /
- /test
- /blog/example
- /events
- /themes/custom/govcms8_uikit_starter/styleguide/section-ui-kit.html

# A set of commands to run while building this service
commands:
# Commands that set up the basic preview infrastructure
init:
- printenv
- apt-get update
# Install bz2 and zip extensions
- apt-get install -y libbz2-dev libzip-dev
- docker-php-ext-install opcache bz2 zip
# Enable headers
- a2enmod headers rewrite

# Install node10/npm to build source
- curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
- apt-get install -y nodejs

# # Install drush-launcher
- wget -O /usr/local/bin/drush
https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar
- chmod +x /usr/local/bin/drush

# Install a vanilla govcms-project site under /var/govcms and link it to DOCROOT.
- rm -Rf /var/govcms
- COMPOSER_MEMORY_LIMIT=-1 composer create-project govcms/govcms8-project --stability dev --no-interaction --verbose /var/govcms
- ln -snf "/var/govcms/docroot" "${DOCROOT}"

# Prepare for install.
- cp "${TUGBOAT_ROOT}/.tugboat/settings.php" /var/govcms/docroot/sites/default/
- mkdir -p "/var/govcms/docroot/sites/default/files"
- chgrp -R www-data "/var/govcms/docroot/sites/default/files"
- find "/var/govcms/docroot/sites/default/files" -type d -exec chmod 2775 {} \;
- find "/var/govcms/docroot/sites/default/files" -type f -exec chmod 0664 {} \;

# Install the site.
- rm -rf /var/govcms/docroot/profiles/govcms/config/sync # In some cases the sync directory is created and a re-install fails.
- cd /var/govcms && drush -r "${DOCROOT}" site:install govcms install_configure_form.update_status_module='array(FALSE,FALSE)' -y
- cd /var/govcms && drush -r "${DOCROOT}" pm:enable govcms8_default_content -y

# Cuts down on image size, although makes initial preview loading slower.
- cd /var/govcms && drush -r "${DOCROOT}" cr -y

# Commands that import files, databases, or other assets. When an
# existing preview is refreshed, the build workflow starts here,
# skipping the init step, because the results of that step will
# already be present.
update:
# We have no external assets to update for testing the distro.

build:
# use this latest version of the theme branch as the default theme for testing
- rm -rf ${DOCROOT}/themes/contrib/govcms8_uikit_starter
- mkdir -p "${DOCROOT}/themes/custom"
- ln -snf "${TUGBOAT_ROOT}" "${DOCROOT}/themes/custom/govcms8_uikit_starter"

# double check version in use
- cd "${DOCROOT}/themes/custom/govcms8_uikit_starter"
- git log --oneline -1

# rebuild all assets
- npm run setup
- npm run gulp
- npm run styleguide

- drush -r "${DOCROOT}" cache-rebuild
- drush -r "${DOCROOT}" updb -y

visualdiffs:
- /
- /test
- /blog/example
- /events

# What to call the service hosting MySQL. This name also acts as the
# hostname to access the service by from the php service.
mysql:
# Use the latest available 5.x version of MySQL
image: tugboatqa/mysql:5

# A set of commands to run while building this service
commands:
# Commands that import files, databases, or other assets. When an
# existing preview is refreshed, the build workflow starts here,
# skipping the init step, because the results of that step will
# already be present.
update:
# Copy a database dump from an external server. The public
# SSH key found in the Tugboat Repository configuration must be
# copied to the external server in order to use scp.
# - scp [email protected]:database.sql.gz /tmp/database.sql.gz
# - zcat /tmp/database.sql.gz | mysql tugboat
# - rm /tmp/database.sql.gz
37 changes: 37 additions & 0 deletions .tugboat/settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* GovCMS Drupal settings for Tugboat only.
*
* Most settings based on Drupal defaults.
* Comments removed for brevity.
* @see https://git.drupalcode.org/project/drupal/blob/8.8.x/sites/default/default.settings.php
*/
$databases = [];
$config_directories = array(
CONFIG_SYNC_DIRECTORY => 'sites/default/files/sync',
);
$settings['hash_salt'] = 'djfu983roawei90tk3;mva9023i9523';
$settings['update_free_access'] = FALSE;
$settings['file_scan_ignore_directories'] = [
'node_modules',
'bower_components',
];
$settings['entity_update_batch_size'] = 50;
$databases['default']['default'] = array (
'database' => 'tugboat',
'username' => 'tugboat',
'password' => 'tugboat',
'prefix' => '',
'host' => 'mysql',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);
if (PHP_SAPI === 'cli') {
ini_set('memory_limit', '256M');
}
$settings['trusted_host_patterns'] = ['.*'];
$config['system.logging']['error_level'] = 'verbose';
error_reporting(E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# GovCMS 8 UI-Kit Starter
[![CircleCI](https://circleci.com/gh/govcms/govcms8_uikit_starter.svg?style=svg)](https://circleci.com/gh/govcms/govcms8_uikit_starter)

This theme implements UI Kit into GovCMS. It makes use of the templates provided
in govcms8_uikit and extends them to work with Drupal. It also provide styling
Expand All @@ -13,7 +14,7 @@ for the layout templates and modifiers from _govcms8_foundations_ module.

### Production setup

* run command `gulp`
* run command `npm run gulp`

**This will produce:**
* compressed CSS output
Expand All @@ -22,7 +23,7 @@ for the layout templates and modifiers from _govcms8_foundations_ module.

### Development setup

* run command `gulp dev`
* run command `npm run gulp dev`

**This will produce:**
* nested CSS output
Expand All @@ -33,7 +34,7 @@ for the layout templates and modifiers from _govcms8_foundations_ module.

### JS Linting

* run command `gulp js-lint`
* run command `npm run js-lint`

This will check for common errors in your JS files.
Its not a part of the watch task.
Expand Down
23 changes: 12 additions & 11 deletions assets/js/back_to_top.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@

Drupal.behaviors.govcms8_uikit_starter_BackToTop = {
attach: function (context, settings) {
var backToTop = $("#back-to-top button");
var $body = $('body, html');
var backToTop = $('.back-to-top__link', context);

// Toggle class on backToTop.
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 250) {
backToTop.addClass('is-visible');
} else {
backToTop.removeClass('is-visible');
}
});
$(window).scroll(function () {
if ($(this).scrollTop() > 250) {
backToTop.addClass('is-visible');
} else {
backToTop.removeClass('is-visible');
}
});

// Scroll smoothly to top on click.
backToTop.click(function (event) {
$('body,html').animate({
$body.animate({
scrollTop: 0
}, 800);
}, 800, function () {
$body.attr('tabindex','-1').focus().removeAttr('tabindex');
});
event.preventDefault();
});

Expand Down
19 changes: 0 additions & 19 deletions assets/js/nav_toggle.js

This file was deleted.

11 changes: 11 additions & 0 deletions assets/scss/components/form/_form.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.webform-options-display-side-by-side .au-form-group + .au-form-group {
@include AU-space(margin-top, 0);
}

.au-form-group + .au-fieldset {
@include AU-space(margin-top, 1unit);
}

.au-fieldset + .au-fieldset {
@include AU-space(margin-top, 2unit);
}
16 changes: 13 additions & 3 deletions assets/scss/components/header/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@

// Logo and search box should be aligned.
.header--vertical-align {
display: flex;
align-items: center;
}
@include AU-media(xs) {
display: flex;
align-items: center;
}

.logo,
.search {
width: 100%;

@include AU-media(xs) {
width: 50%;
}
}
}
28 changes: 28 additions & 0 deletions assets/scss/components/header/_header_search.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Styling for header search form.
*/

@function magnifying-glass($color) {
$color-no-hash: unquote(str-slice(quote($color), 2));
@return url("data:image/svg+xml,%3Csvg%20width%3D%2230%22%20height%3D%2230%22%20viewBox%3D%220%200%2030%2030%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210.5%22%20stroke%3D%22%23#{$color-no-hash}%22%20stroke-width%3D%223%22%2F%3E%3Cpath%20d%3D%22M21%2019L30%2028L28%2030L19%2021L21%2019Z%22%20fill%3D%22%23#{$color-no-hash}%22%2F%3E%3C%2Fsvg%3E");
}

.search {
@include AU-space(margin-top, 1.6unit);

@include AU-media(xs) {
margin-top: 0;
}

.form-submit {
text-indent: -999px;
background-image: magnifying-glass($AU-color-background);
background-size: 24px;
background-repeat: no-repeat;
background-position: center;

.au-header--dark & {
background-image: magnifying-glass($AU-colordark-background);
}
}
}
1 change: 1 addition & 0 deletions assets/scss/components/navigation/_back-to-top.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
transition: all 600ms ease-in-out;
z-index: -1;

&:focus,
&.is-visible {
opacity: 1;
transition: all 300ms ease-in-out;
Expand Down
6 changes: 6 additions & 0 deletions assets/scss/components/navigation/_main_nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Main menu styling for default and alt style.
*/
.au-main-nav {
@include AU-space(margin-top, 1.6unit);
}
Loading

0 comments on commit e82e925

Please sign in to comment.