-
Notifications
You must be signed in to change notification settings - Fork 3
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
SHS 5130 Use <hr> when there is no color band text #1398
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mndonx Please see the code comments. Also, please check styles. In Chrome, the hr
has an inset border. Make sure that the hr
styles match the empty h2
.
{% if color_band_text %} | ||
<h2 class="hb-color-band--text">{{ color_band_text }}</h2> | ||
{% else %} | ||
{{ '<hr class="hb-color-band--text" />' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just add the html tag directly?
<hr class="hb-color-band--text" />
I might be missing something, but I see no need to print it as a twig string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why I did this!
Thanks @cienvaras, ready for re-review. |
@@ -73,4 +73,8 @@ | |||
padding: hb-calculate-rems(20px); | |||
} | |||
} | |||
|
|||
hr { | |||
border: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mndonx We're almost there, just a little extra thing to fix. The top and bottom margin is different in the hr
. There are not explicit rules in the theme for that, but the browser is adding some default styles. I checked in multiple browsers and it's consistent, so it should be fixed adding this to the hr
styles:
margin-block-start: 0.83em;
margin-block-end: 0.83em;
font-size: 3.6rem;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cienvaras Good eye, thank you! I also found another instance where the logic needed to be applied (in the original pattern.) Let me know if you spot anything else. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great, thanks 🚀
READY FOR REVIEW
Summary
This PR checks the Color Band component for text, and, if there is no text, prints an
tag instead of an empty heading tag.
Urgency
medium
Steps to Test
<hr>
tag prints inside the color band.PR Checklist