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

D8CORE-628: Add caption option to hero banner. #517

Merged
merged 10 commits into from
Oct 25, 2019
Merged

D8CORE-628: Add caption option to hero banner. #517

merged 10 commits into from
Oct 25, 2019

Conversation

sherakama
Copy link
Member

READY FOR REVIEW

Summary

  • Creates a caption option for the hero banner

Review By (Date)

  • October 25th if you can

Urgency

Steps to Test

  1. Review code
  2. Build and render styleguide
  3. Review .su-hero--caption variant

Affected Projects or Products

  • D8CORE

Associated Issues and/or People

  • D8CORE-628

See Also

@sherakama
Copy link
Member Author

@sherakama
Copy link
Member Author

@sherakama sherakama temporarily deployed to Tugboat October 23, 2019 18:22 Destroyed
@sherakama
Copy link
Member Author

@yvonnetangsu
Copy link
Member

@sherakama , is the design for the caption version going into Figma? Is the text for the caption always right-aligned?

It seems like you might want to hide the caption in the default for mobile breakpoints
Screen Shot 2019-10-23 at 3 25 12 PM

@sherakama
Copy link
Member Author

@kerri-augenstein see @yvonnetangsu 's question about Figma.

I got the design option from: https://stanfordits.atlassian.net/browse/D8CORE-628

@sherakama sherakama temporarily deployed to Tugboat October 23, 2019 23:37 Destroyed
@sherakama sherakama temporarily deployed to Tugboat October 23, 2019 23:39 Destroyed
@sherakama
Copy link
Member Author

@yvonnetangsu captions gone on non-caption variant.

https://pr517-8ihnc8ppp7ovm1lh8vxtwt0jr50ixlli.tugboat.qa/item-components-hero.html

display: block;

p {
@include credits;
Copy link
Member

Choose a reason for hiding this comment

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

The caption currently in this PR is larger and darker than it should be, but the credits/caption font sizes and colors are being worked on in my media component PR, so this would fix itself later after that's merged in.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm overriding the style for the <p> element only and it will be up to the user to supply the correct html and styles they want.

Copy link
Member

@yvonnetangsu yvonnetangsu Oct 25, 2019

Choose a reason for hiding this comment

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

Sure, that makes total sense. Just want to document here that the base <p> will look different since @credits is being worked on.


// Only allow for 60% width on large screen sizes.
@include grid-media('lg') {
@include padding(null null null 40%);
Copy link
Member

Choose a reason for hiding this comment

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

This 40% padding-left looks larger than 40% because it's 40% of the full browser width (including the screen edges) instead of 40% of the center container width. If the width doesn't have to be exactly 60% then it would probably look close enough with padding-left:30%. This issue is more obvious when the browser is really wide (try resizing to 2000px, the caption gets quite narrow).

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeah, good catch. I was thinking since it was full width but it really isn't. I have revised.

Comment on lines +62 to +66
@include margin(96px null 0 null);
bottom: 48px;
left: 48px;
max-width: 450px;
top: auto;
Copy link
Member

Choose a reason for hiding this comment

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

In the future you might want to finetune the position of the card when the banner is full browser width, but that's probably for another PR. For our WordPress template, if the banner is full width, we line up the edge of the box with the edge of the center container, e.g., if the box/card is on the left, its left edge lines up with the left edge of the logo lockup.

Copy link
Member

Choose a reason for hiding this comment

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

FYI this is what we have

Screen Shot 2019-10-23 at 5 30 44 PM

Copy link
Member Author

@sherakama sherakama Oct 24, 2019

Choose a reason for hiding this comment

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

This is existing code that was outside its scope. Before, this .su-card class was not nested under the .su-hero class and was affecting cards elsewhere. What you have in the redwood theme looks great.

@sherakama sherakama temporarily deployed to Tugboat October 24, 2019 03:14 Destroyed
Comment on lines +44 to +51
@include grid-media("lg") {
width: ceil($su-screen-lg * 0.6);
}
@include grid-media("xl") {
width: ceil($su-screen-xl * 0.6);
}
@include grid-media("2xl") {
width: ceil($su-screen-2xl * 0.6);
Copy link
Member

Choose a reason for hiding this comment

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

Are we using fixed width container and not fluid 60%? I'm totally fine with this - looks close enough. Just want to double check because it's a little different from the request.

display: block;

p {
@include credits;
Copy link
Member

@yvonnetangsu yvonnetangsu Oct 25, 2019

Choose a reason for hiding this comment

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

Sure, that makes total sense. Just want to document here that the base <p> will look different since @credits is being worked on.

@@ -31,15 +31,24 @@
@include modular-spacing(padding-bottom, 2);
text-align: right;
Copy link
Member

Choose a reason for hiding this comment

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

This might be a @kerri-augenstein question. When the caption container isn't full width, it looks good with text-align: right, but I think it looks a bit unnatural at xs to md breakpoints when the caption takes up the full width and the text is still align to the right. Could we make the caption left-aligned or center-aligned at xs to md breakpoints?

@sherakama sherakama merged commit 1bf07cc into master Oct 25, 2019
@sherakama sherakama deleted the D8CORE-628 branch October 25, 2019 23:05
yvonnetangsu added a commit that referenced this pull request Oct 25, 2019
* master:
  Use rem instead of em for big button font size so it doesn't blow up in sections if we set a large base font size; finetune big button padding for smaller breakpoints (#522)
  Change sizes of link icons to use px instead of em to prevent occasional clipping (#523)
  D8CORE-628: Add caption option to hero banner. (#517)
  Use percentage for html root font size instead of px so people can scale up using browser font size preferences (#526)
  Mixins documention update — @centered-column (#448)
  Adds Tugboat and fixes npm dependencies. (#518)
yvonnetangsu added a commit that referenced this pull request Oct 29, 2019
* master: (28 commits)
  Updated packages and configuration files. (#527)
  Use rem instead of em for big button font size so it doesn't blow up in sections if we set a large base font size; finetune big button padding for smaller breakpoints (#522)
  Change sizes of link icons to use px instead of em to prevent occasional clipping (#523)
  D8CORE-628: Add caption option to hero banner. (#517)
  Use percentage for html root font size instead of px so people can scale up using browser font size preferences (#526)
  Mixins documention update — @centered-column (#448)
  Adds Tugboat and fixes npm dependencies. (#518)
  Update _hero.scss (#513)
  Create Aspect Ratio Mixin (#445)
  Adding global footer variants and link tweaks for legibility, change layout at MD breakpoint to match Figma (#500)
  Updated package and lock files.
  Add parameter to @link-icon to adjust vertical position of icon and different options for $animate parameter (#504)
  Delete card-2019-08-28.twig (#506)
  Update _input.scss (#507)
  Scale down type-a and type-b font size at xs and sm breakpoints, repurpose splash font and minor typography tweaks (#498)
  Add 4 new @modular-spacing steps (#6 to #9) and modify 2 existing steps (#3 and #4) (#503)
  add su- prefix to Decanter core and component variables, deprecate old names (#452)
  Includevar (#496)
  Put appearance back for select dropdowns (#479)
  Split input.scss into several files and add new input-base placeholder (#476)
  ...

# Conflicts (resolved manually)
#	core/dist/css/decanter.css
#	core/src/scss/components/card/_card.scss
#	core/src/scss/components/card/index.scss
#	core/src/scss/utilities/placeholders/components/_card.scss
#	core/src/templates/components/card/card.twig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants