Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
8.4.5
Browse files Browse the repository at this point in the history
Release Date: 2020-05-15

D8CORE-2004 JS Error in stanford_basic local tabs. (#159) (a892e90)
D8CORE-1869: Added circleci configuration (#158) (08f4fae)
D8CORE-1022: Tweak Edit Buttons display in D8 page authoring (#129) (9a6243d)
  • Loading branch information
imonroe authored May 15, 2020
2 parents 598601f + 81f7273 commit edcf6ff
Show file tree
Hide file tree
Showing 15 changed files with 271 additions and 55 deletions.
43 changes: 43 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: 2
# CircleCI integration with Drupal 8.

## Defines images and working directory.
defaults: &defaults
docker:
- image: pookmish/drupal8ci:pcov
- image: selenium/standalone-chrome:3.141.59-neon
- image: mariadb:10.3
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
working_directory: /var/www/html

#Jobs

back_to_dev: &back_to_dev
<<: *defaults
steps:
- checkout
- run:
name: Back to dev
command: |
composer global require SU-SWS/stanford-caravan:dev-8.x-1.x
~/.composer/vendor/bin/sws-caravan back-to-dev ${CIRCLE_TAG} ${CIRCLE_WORKING_DIRECTORY}
# Declare all of the jobs we should run.
jobs:
run-back-to-dev:
<<: *back_to_dev

# Declare a workflow that runs all of our jobs in parallel.
workflows:
version: 2
after_release:
jobs:
- run-back-to-dev:
filters:
tags:
only:
- /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*).*?$/
branches:
ignore:
- /.*/
8 changes: 8 additions & 0 deletions .github/auto-label.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rules": {
"patch": ["*.info.yml"],
"frontend": ["*.js", "*.scss", "*.css", "*.twig", ".theme"],
"backend": ["*.php", "*.module"],
"ci": [".circleci", "blt", ".github"]
}
}
27 changes: 27 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler/blob/master/README.md

name: PR Labeler
on:
pull_request:
types: [opened, synchronize]
jobs:
pr-labeler:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: codelytv/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_max_size: '100'
s_max_size: '500'
m_max_size: '1000'
l_max_size: '3000'
fail_if_xl: 'false'
- uses: banyan/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Stanford Basic Theme

8.x-4.5
--------------------------------------------------------------------------------
_Release Date: 2020-05-15_

- D8CORE-2004 JS Error in stanford_basic local tabs. (#159) (a892e90)
- D8CORE-1869: Added circleci configuration (#158) (08f4fae)
- D8CORE-1022: Tweak Edit Buttons display in D8 page authoring (#129) (9a6243d)

8.x-4.4
--------------------------------------------------------------------------------
_Release Date: 2020-04-17_
Expand Down
2 changes: 1 addition & 1 deletion dist/css/theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/behaviors.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/js/behaviors.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// Theme code.
import './theme/index.js';
import './stanford_basic.behavior.js';
8 changes: 8 additions & 0 deletions src/js/stanford_basic.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ export default {
if (!$sn) {
$('.su-skipnav--secondary', context).remove();
}

// Add an outline class to the page-content region if local tasks are
// available.
var localTab = $('#block-stanford-basic-local-tasks', context);
if (localTab.length) {
$('.page-content', context).addClass('stanford-basic--outline');
}

})(jQuery);
},

Expand Down
6 changes: 6 additions & 0 deletions src/js/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Primary roll up file
*/

// The Local Task Menu
import './menu/index.js';
33 changes: 33 additions & 0 deletions src/js/theme/menu/StickyHeaderOnScroll.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
var header = document.getElementById('block-stanford-basic-local-tasks');
var sticky = 0;

if (header) {
sticky = header.getBoundingClientRect().top;
window.onscroll = function () {
stickyHeaderOnScroll();
};
}

/**
* Stick the local block tasks to the top of the window.
*/
function stickyHeaderOnScroll() {
var toolbarHeight = 0;
var toolbarOpen = document.body.classList.contains('toolbar-tray-open');

if (toolbarOpen === true) {
toolbarHeight = 79;
}
else {
toolbarHeight = 39;
}

if (window.pageYOffset >= sticky - toolbarHeight) {
header.classList.add('sticky');
header.style.marginTop = toolbarHeight + 'px';
}
else {
header.classList.remove('sticky');
header.style.marginTop = '0px';
}
}
1 change: 1 addition & 0 deletions src/js/theme/menu/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './StickyHeaderOnScroll.js';
115 changes: 101 additions & 14 deletions src/scss/theme/menu/_local-tasks.scss
Original file line number Diff line number Diff line change
@@ -1,34 +1,121 @@
@charset 'UTF-8';

// view/edit/delete/manage tabs.
.block--local-tasks {
@include margin(0 auto 10px auto);
border-bottom: solid 2px $su-color-cardinal-red;
.stanford-basic--outline {
outline: 0;
position: relative;
transition: outline 0.5s ease-in-out;
z-index: 103;

nav {
@include centered-column;
.block--local-tasks {
opacity: 0;
transition: opacity 0.5s ease-in-out;
}

&:focus,
&:hover {
outline: 5px solid rgb(137, 206, 255);
outline-offset: -5px;

.block--local-tasks {
opacity: 1;
}
}
}

.block--local-tasks {
@include margin(0 auto 10px auto);
z-index: 102;

ul,
li {
@include margin(0);
}

ul {
display: flex;
flex-direction: row;
}

&.sticky {
position: fixed;
top: 0;
width: 100%;
z-index: 102;
}

.page-content-label {
@include padding(10px 1em);
color: $su-color-white;
background-color: $su-color-blue;
border-right: 1px solid #00548f;
border-bottom: 1px solid #00548f;
font-weight: 400;
order: 1;
}

.edit {
order: 3;
}

.delete {
order: 4;

a {
font-size: 0;

&::before {
@include padding(null 1em);
font-family: 'Font Awesome 5 Free';
content: '\f2ed';
font-size: 1.6rem;
font-weight: 400;

@include grid-media-min('md') {
font-size: 1.8rem;
}

@include grid-media-min('2xl') {
font-size: 1.9rem;
}
}
}
}

.manage-display {
margin-left: auto;
order: 5;
}

.layout,
.shortcuts {
order: 6;
}

.version-history,
.roles {
order: 2;
}

.viewspan-classvisually-hiddenactive-tab-span,
.devel {
display: none;
}

a {
@include padding(7px null);
@include padding(10px null);
font-weight: 400;
color: $su-color-white;
background-color: $su-color-stone;
border: solid 2px $su-color-stone;
border-bottom: 0;
background-color: $su-color-bright-blue;
border-right: 1px solid #00548f;
border-bottom: 1px solid #00548f;
}

a {
&:hover,
&:focus,
&.is-active {
color: $su-color-stone;
background-color: $su-color-white;
border: solid 2px $su-color-cardinal-red;
border-bottom: 0;
color: $su-color-white;
background-color: $su-color-blue;
}
}
}
57 changes: 19 additions & 38 deletions stanford_basic.info.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,28 @@
name: Stanford Basic
name: 'Stanford Basic'
type: theme
description: 'Stanford Basic Branding Theme.'
package: Stanford
version: 8.x-4.4
core_version_requirement: ^8 || ^9
base theme: stable

version: 8.x-4.5
core_version_requirement: '^8 || ^9'
'base theme': stable
regions:
page_top: 'Page top'
header: Header
search: Search
menu: Menu
help: Help
content: Content
footer: Footer
page_bottom: 'Page bottom'

page_top: 'Page top'
header: Header
search: Search
menu: Menu
help: Help
content: Content
footer: Footer
page_bottom: 'Page bottom'
features:
- favicon
- logo

- favicon
- logo
component-libraries:
basic:
paths:
- templates
basic-dist:
paths:
- dist/templates

basic: { paths: [templates] }
basic-dist: { paths: [dist/templates] }
libraries:
- stanford_basic/basic

- stanford_basic/basic
ckeditor_stylesheets:
- dist/css/ckeditor.css

- dist/css/ckeditor.css
libraries-override:
jumpstart_ui/base: false

# Not working yet.
# Waiting on: https://www.drupal.org/project/drupal/issues/474684
# dependencies:
# - ui_patterns
# - ui_patterns_layouts
# - ui_patterns_library
# - layout_discovery
# - jumpstart_ui
jumpstart_ui/base: false
10 changes: 10 additions & 0 deletions stanford_basic.theme
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,13 @@ function stanford_basic_pattern_process_contextual(array $element) {
}
return $element;
}

/**
* Implements hook_preprocess_HOOK().
*/
function stanford_basic_preprocess_menu_local_task(&$variables) {
if ($variables['link']['#url']->getRouteName() == 'entity.node.version_history') {
$variables['link']['#title'] = t('Version History');
}
$variables['attributes']['class'][] = strtolower(Html::cleanCssIdentifier($variables['link']['#title']));
}
5 changes: 4 additions & 1 deletion templates/menus/menu-local-tasks.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
#}
{% if primary %}
<h2 class="visually-hidden">{{ 'Primary tabs'|t }}</h2>
<ul class="tabs primary">{{ primary }}</ul>
<ul class="tabs primary">
<li class="tabs__tab page-content-label">{{ 'Page Content'|t }}</li>
{{ primary }}
</ul>
{% endif %}
{% if secondary %}
<h2 class="visually-hidden">{{ 'Secondary tabs'|t }}</h2>
Expand Down

0 comments on commit edcf6ff

Please sign in to comment.