-
Notifications
You must be signed in to change notification settings - Fork 332
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
Add outline to tag for customised colours #855
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.
I know you flagged this as part of your comment, but this results in the height of this component changing from 25px to 27px. As far as I know, all components should have a height which is a multiple of 5px.
src/components/tag/_tag.scss
Outdated
|
||
display: inline-block; | ||
padding: govuk-spacing(1) 8px 0; | ||
padding-top: .3125em; |
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.
Given we've got #845 open to try and remove our only current usage of em
for padding, do we want to be introducing it again here, or should we be using pixels?
Also, can this be a single padding
rule as the values are all the same?
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'd prefer to use relative units since it means when the tag is resized the padding is in proportion. Will show screenshots, before and after PX.
The padding results are not all the same, but I'll see if I can reduce the repeitition (I personally do not like shorthand since it's like doing function(many, arguments, order, isimportant)
vs function({ order: 'not important' })
etc)
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 think other components like the button keep the same dimensions when the font-size reduces (because the line-height is constant) so I'd expect this component to work in the same way… especially as we want to keep the /5 vertical rhythm.
Totally failed to notice that padding-bottom was different so… that's fine 👍
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.
OK, good to know, thanks Ollie. I still think the relative spacing looks more balanced but if it's to get the grid alignment that makes sense I guess...
(Should probably have this written down)
36706b6
to
5b563cc
Compare
@36degrees I've adjusted this PR based on your comments and ended up with something very similar to the original: |
dd3e3e6
to
c23ee45
Compare
src/components/tag/_tag.scss
Outdated
|
||
display: inline-block; | ||
padding: govuk-spacing(1) 8px 0; | ||
padding: 4px 6px 1px; |
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.
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.
Could do yeah, would prefer to use borders since we can 'see' them. Up to 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.
I'll change this, it also means the modifiers get outlines for free without additional CSS :)
c23ee45
to
da8ed7d
Compare
When a user customises their colours often the background is removed, by adding a outline we ensure that the tag component still keeps it's meaning.
da8ed7d
to
333f1eb
Compare
👏 |
Adds a border to the tag element so it makes more sense when colours are overridden.
The screenshots I've included here show the tag component when used in the phase banner component.
Uses relative spacing to keep alignment when the label is on a smaller screen.
Before overriden colours
After overriden colours
Before regular colours
After regular colours
Smaller screens:
Before overriden colours
After overriden colours
Before regular colours
After regular colours