Skip to content

Commit

Permalink
CHEMH-60, CHEMH-61: Section background colors (#93)
Browse files Browse the repository at this point in the history
* CHEMH-60: initial commit

* CHEMH-60 CHEMH-61: adding a light and dark grey section background

* CHEMH-60: Fixes to the links and buttons on dark grey

* CHEMH-60: Fixups to all the paragraphs on dark grey

* fixups for feedback

* fixup to the cards with links in the body

* updated version number
  • Loading branch information
jenbreese authored May 1, 2024
1 parent 682059d commit b672311
Show file tree
Hide file tree
Showing 9 changed files with 581 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# [ChEM-H Subtheme](https://github.com/SU-SWS/chem_h_subtheme)
##### Version: 2.2.9
##### Version: 2.3.0

Changelog: [Changelog.txt](CHANGELOG.txt)

Expand Down
2 changes: 1 addition & 1 deletion chem_h_subtheme.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ChEM-H Subtheme
type: theme
description: 'ChEM-H Subtheme.'
package: Stanford
version: 2.2.9
version: 2.3.0
core_version_requirement: ^9 || ^10
base theme: stanford_basic
libraries:
Expand Down
22 changes: 21 additions & 1 deletion chem_h_subtheme.react_behaviors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,24 @@ banner_variant_info: # part of the key after the :
chemh-wrapper--banner-halfpill: Halfpill variant
chemh-wrapper--banner-halfpill-title: Halfpill Title variant
chemh-wrapper--banner-homepage: Homepage variant

layout_variant_info:
id: layout_style
label: 'Layout Paragraph Type'
bundles:
- paragraphs_type|stanford_layout
config:
section_color:
type: select
title: Section background color
description: Choose the section background color.
empty_option: Default
options:
chemh-section-color--su-black: Dark Grey
chemh-section-color--light-grey: Light Grey
padding_bottom:
type: select
title: Section padding bottom
description: Choose the section padding bottom.
empty_option: Default
options:
chemh-section-pb-none: None
14 changes: 14 additions & 0 deletions chem_h_subtheme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,17 @@ function chem_h_subtheme_preprocess_field__node__title__stanford_person(&$variab
];
}
}

/**
* Implements hook_preprocess_paragraph__stanford_layout().
*/
function chem_h_subtheme_preprocess_paragraph__stanford_layout(array &$variables): void {
/** @var \Drupal\paragraphs\Layout\Paragraph $paragraph */
$paragraph = &$variables['paragraph'];
$existing_classes = $variables['attributes']['class'] ?? [];
$extra_classes = [
$paragraph->getBehaviorSetting('react_paragraphs:layout_variant_info', 'padding_bottom'),
$paragraph->getBehaviorSetting('react_paragraphs:layout_variant_info', 'section_color'),
];
$variables['attributes']['class'] = array_merge($existing_classes, $extra_classes);
}
2 changes: 1 addition & 1 deletion dist/css/chem_h_subtheme.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/scss/components/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// Components.
// @import 'component-name/index';

@import 'layout/index.scss';
@import 'banner/index.scss';
@import 'card/index.scss';
@import 'events/index.scss';
Expand Down
Loading

0 comments on commit b672311

Please sign in to comment.