Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHEMH-77: A fullpill banner #68

Merged
merged 15 commits into from
Sep 26, 2023
1 change: 1 addition & 0 deletions chem_h_subtheme.react_behaviors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ banner_variant_info: # part of the key after the :
# default_value: chemh-wrapper--banner-default
options:
chemh-wrapper--banner-default: Default variant
chemh-wrapper--banner-fullpill: Fullpill variant
chemh-wrapper--banner-halfpill: Halfpill variant
chemh-wrapper--banner-homepage: Homepage variant

7 changes: 0 additions & 7 deletions chem_h_subtheme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,6 @@ function chem_h_subtheme_preprocess_card(&$variables) {
// Add card type class to card wrapper. 3rd variable provides the default card type.
$card_info['card_type'] = $paragraph->getBehaviorSetting('react_paragraphs:card_variant_info', 'card_type', 'su-card-wrapper--default');
$variables['attributes']['class'][] = $card_info['card_type'];

$imageCount = $paragraph->get('su_card_media')->count();

// Check for media in a card then set classes.
if (!$imageCount) {
return;
}
}

/**
Expand Down
Binary file added dist/assets/png/fullpill-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions dist/assets/svg/fullpill-bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/css/chem_h_subtheme.css

Large diffs are not rendered by default.

Binary file added src/assets/png/fullpill-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/assets/svg/fullpill-bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
143 changes: 143 additions & 0 deletions src/scss/components/banner/_banner--fullpill.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
@charset "UTF-8";

$banner-circle--image-width: 200px;
$banner-circle--sm-image-width: 150px;


.chemh-wrapper--banner-fullpill {
max-width: calc(100vw - 200px);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this max-width constraint is causing some issues for mobile, can you address that?
Screenshot 2023-09-21 at 12 33 58 PM

margin: 0 auto;

.su-hero {
background: $su-color-black url("../../assets/svg/fullpill-bg.svg") no-repeat 100% / 200%;
border-radius: 300px;
color: $su-color-white;
flex-direction: row;
justify-content: flex-start;
align-items: center;
min-height: 400px;

@include grid-media-max('md') {
background: $su-color-black url("../../assets/svg/fullpill-bg.svg") no-repeat 100% / 205%;

@include modular-spacing('padding', 3);
}

@include grid-media-max('sm') {
background-size: cover;
}

@include modular-spacing('padding-top', 3);
@include modular-spacing('padding-bottom', 3);



.su-hero__media {
background: transparent;
margin-left: 5%;
min-height: unset;
position: unset;
height: unset;
width: unset;

img { // Image display has been set to media image style - Medium (220)
@include modular-spacing('margin-bottom', -2);

border-radius: 50%;
width: $banner-circle--image-width;
height: $banner-circle--image-width;
margin-left: auto;
margin-right: auto;
object-fit: cover;
padding: 0;

@include grid-media-max('sm') {
width: $banner-circle--sm-image-width;
height: $banner-circle--sm-image-width;
}
}
}

.su-card {
&.su-hero__card {
background: transparent;
border: none;
bottom: unset;
box-shadow: none;
left: unset;
margin-top: unset;
margin-bottom: unset;
max-width: unset;
top: unset;

& > .image {
@include grid-media-min('sm') {
max-width: $banner-circle--image-width;
min-width: $banner-circle--image-width;

margin-left: 50px;

img {
border-radius: 50%;
}
}

}

.su-card__contents {

h2 {
@include responsive-spacing('margin-bottom', -1);
@include chemh-heading--badge;
@include type-a;

color: $su-color-white;
font-family: $su-font-sans;

}

.su-card__link,
.su-card__button {
@include responsive-spacing('margin-top', 3);
}
}
}

}
}

// Link colors.
div {
.su-button,
.su-card__button {
a {
background-color: $su-color-black;
color: $su-color-white;
}
}
}

.su-button:not(.su-link--external):after,
.su-button:not(.su-link--external):after {
background: url(../../assets/svg/icon_east_white.svg) no-repeat 0 0;
}
}


// when on a page with a sidebar nav, needs adjustments:
.jumpstart-ui--two-column.centered-container {
.flex-lg-9-of-12.main-region {
.su-hero {
// when on a sidebar-nav page, needs less bottom spacing
@include modular-spacing('padding-bottom', 5);

.su-card__contents {
// @apply mx-auto;
max-width: 90%;
@include grid-media-min('lg') {
max-width: 80%;
}
}
}
}
}
3 changes: 3 additions & 0 deletions src/scss/components/banner/_banner--general.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@charset "UTF-8";


6 changes: 4 additions & 2 deletions src/scss/components/banner/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

// Banner Roll Up

@import 'halfpill';
@import 'homepage';
@import 'banner--halfpill';
@import 'banner--fullpill';
@import 'banner--general';
@import 'banner--homepage';
1 change: 0 additions & 1 deletion src/scss/components/card/index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@charset "UTF-8";

// Card Roll Up

@import 'minimal-border';
5 changes: 5 additions & 0 deletions src/scss/utilities/variables/_sizes.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@charset "UTF-8";

// Max-width variables for _banner-in-page--no-image.scss
$banner-b--lg: 864px;
$banner-b--xl: 1024px;
1 change: 1 addition & 0 deletions src/scss/utilities/variables/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

@import 'colors';
@import 'magic-numbers';
@import 'sizes';
Loading