-
Notifications
You must be signed in to change notification settings - Fork 9
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
Update taxonomy sidebar design #1222
Conversation
We are developing a new related links component in government-frontend. We need to bring the taxonomy sidebar component design in line with the new related links.
b1efbf2
to
3ce8eb2
Compare
3ce8eb2
to
26f5dc9
Compare
'Part of' links are moving to the sidebar navigation, so they need to be present in the taxonomy sidebar.
26f5dc9
to
179473f
Compare
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.
We need to avoid making global rather than targeted changes to links etc on the page.
margin-bottom: $gutter-one-third; | ||
} | ||
|
||
a { |
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.
We usually wouldn't style an "a" directly. Sometimes we are forced to, but we absolutely need to ensure we're not styling all a tags on the page, so
.taxon-description a { blah }
or something may be necessary - ideally though the anchor would have a styling class such as .govuk-taxonomy-sidebar__link
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.
These seem to be nested within the selector at the top, but massive 👍 to always avoiding styling base elements if possible.
We should only be doing this if there's no other way as it directly conflicts with our naming conventions that allow us to have confidence with components across so many applications.
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.
Specifically we're using BEM and namespacing
text-decoration: none; | ||
} | ||
|
||
nav { |
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.
again, this needs to be scoped
margin-bottom: $gutter; | ||
} | ||
|
||
li { |
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.
scoping needed
li { | ||
padding: 0; | ||
list-style-type: none; | ||
margin-bottom: $gutter-one-third; | ||
} | ||
|
||
ul { |
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.
scope
@maxgds @NickColley I'm confused about requested changes, could you clarify what, if anything, needs changing on this PR please? |
I hadn't noticed the things I commented on were nested, as such they are they are safe to go out. However, we shouldn't really be applying the css directly to elements even when embedded. I'd say mark it as tech debt, put it on the board in the tech debt column Vanita created and let this go out as-is for now. |
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.
This isn't techincal debt, we should just make the updates in this review, we follow these conventions to make sure do not break GOV.UK.
The diff is confusing - Steve hasn't actually introduced this, hence my comment. And it's relatively safe as it's nested in the scss, not completely bare. |
@NickColley forgive my ignorance, but it's not clear which changes are necessary to make this PR acceptable production-ready component code. |
@steventux if we're writing new CSS we should be using the correct naming conventions (linked above). Old code is fine, and is covered by https://trello.com/c/SCio6yb4/45-static-components-need-updating-to-new-component-principles |
My bad - had cherry-picked a commit from #1200, was unaware this contained the offending CSS |
5beb336
to
c1da5eb
Compare
c1da5eb
to
fa16a21
Compare
@NickColley @maxgds hopefully this e1dc506 sorts out the element selectors. Let me know if I'm off with the BEM naming. |
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.
Personally I'd call govuk-taxonomy-sidebar__items govuk-taxonomy-sidebar__list (singular rather than plural label) but happy to approve this now.
fa16a21
to
fe07f25
Compare
fe07f25
to
0f6ea9b
Compare
0f6ea9b
to
e1dc506
Compare
@NickColley I've amended the component styles so they follow the BEM naming convention, apologies @maxgds for not understanding the original review comments. |
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.
Thanks for making these changes, sorry for the miscommunication earlier - I should have caught up with you in person rather than confusing things in comments.
I've added a non blocking note around how you can think about your classes.
If your classes do not understand what it presents, they we can make them less verbose, since a heading is a heading, regardless if it's for a taxon section or X section.
In the same way that we're trying not to have specific styles for a page, for example .contacts-page-heading
, this logic can be applied to the components too.
This could be done later and does not block the PR, lemme know if I did not make sense and you want to chat in person. 😄
padding-top: $gutter-half; | ||
} | ||
|
||
.govuk-taxonomy-sidebar__related-heading, |
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.
Non blocking:
These classes look to be the same, if we decouple how we present parts of this component from the semantics of this component, could these be change to a single '.govuk-taxonomy-sidebar__heading`?
e1dc506
to
b5a9524
Compare
b5a9524
to
dd42118
Compare
Thanks @NickColley your comment makes sense to me, I've renamed the heading and link classes to simplify: dd42118#diff-b2af3eb92cd75ba5d8c0d1ab14ce7424R7 |
I've addressed Nick's comments #1222 (comment)
https://trello.com/c/zzot5dZq/157-taxonomy-sidebar-add-link-to-collections
https://trello.com/c/NtD5rC4S/121-taxonomy-sidebar
This combines the changes from #1200 to make the taxonomy sidebar styles similar to the related-navigation component and also the feature of rendering collections links below the taxon links.