-
Notifications
You must be signed in to change notification settings - Fork 194
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
changed the add documents and reorder links from p tags to list tags … #8347
Conversation
1a1679c
to
7b3a13e
Compare
@RodneyJohnsonGDS I think that markup is more appropriate now and consistent but I think the use of Also, we should probably be a bit more generic in the way the margins and borders for the links are applied so that it could potentially work for single or multiple links. I'll suggest an alternative in the CSS file. |
@@ -15,7 +15,7 @@ | |||
display: flex; | |||
align-items: center; | |||
|
|||
& > p:first-child { | |||
& > li:first-child { | |||
@include govuk-responsive-padding(2, "right"); | |||
@include govuk-responsive-margin(2, "right"); | |||
border-right: 1px solid $govuk-border-colour; |
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 it would be better to lose the whole app-view-document-collection-group-memberships-index__heading-links
class and add a more generic style nested in the app-view-document-collection-group-memberships-index__heading
element like below.
That way we can just allow the <li>
elements to flow more naturally and add the separating border in a way that doesn't rely on a specific number of links to be present (as it is it would add a rule to the single link for "Add document" when there are none to display). It also centres the vertical rule better and keeps the horizontal alignment with the header.
I think I'd also lose the flexbox layout in the containing element as well because that makes it display oddly on smaller viewports. By floating the <ul>
element we can let it flow underneath the heading in this case, though we do need to change the heading from a block level element to allow this, and give it a bit of a margin to avoid the elements clashing.
Once we're nested inside the very specific app-view-document-collection-group-memberships-index__heading
element I think we can afford to be far more generic in the way we reference elements so I don't think we need to add specific classes for those.
See what you think. I know it's quite a big change but it makes it closer to the sort of styles we are using in related components. (Also I think flexbox can be overused. 😄)
.app-view-document-collection-group-memberships-index__heading {
.gem-c-heading {
display: inline-block;
@include govuk-responsive-margin(2, "right");
}
.govuk-list {
float: right;
li {
display: inline-block;
@include govuk-responsive-padding(2, "left");
@include govuk-responsive-margin(2, "left");
border-left: 1px solid $govuk-border-colour;
&:first-child {
margin-left: 0;
padding-left: 0;
border-left: none;
}
}
}
}
|
||
<div class="app-view-document-collection-group-memberships-index__heading-links"> | ||
<p class="govuk-body govuk-!-text-align-right"> | ||
<ul class="govuk-list app-view-document-collection-group-memberships-index__heading-links"> |
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.
If we use the approach above we can lose the app-view-document-collection-group-memberships-index__heading-links
class here.
<p class="govuk-body govuk-!-text-align-right"> | ||
<%= link_to "Add document", admin_document_collection_group_search_options_path(@collection, @group), class: "govuk-link" %> | ||
</p> | ||
<ul class="govuk-list govuk-body govuk-!-text-align-right"> |
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, if we use the above approach we can lose the govuk-!-text-align-right
class here, and we shouldn't have the govuk-body
class at all.
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.
Looks good, done!
454c598
to
bafd479
Compare
.gitignore
Outdated
@@ -29,3 +29,4 @@ | |||
/node_modules | |||
/yarn-error.log | |||
.cache/ | |||
.DS_Store/ |
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 would need to be more generic to catch all instances of this file as it occurs in many directories and subdirectories (e.g. the one in the app
directory has survived). I'm not sure we should need to add this though if we make sure we don't commit those files.
bafd479
to
688bf80
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.
LGTM 👍
…cuments within Document Collections In this commit we changed the way that the css class responsible for the heading links were designed, making them more generic and therefore easier to reuse for future developments.
75a6035
to
da31330
Compare
…as these are more semantically and stylistally correct
This commit is a continuation from a previously closed and merged branch, can be founder here:
#8318 (comment)
This commit user story can be found in this Trello link: https://trello.com/c/kEcGRQ1X/531-allow-for-the-reordering-of-documents-within-a-group
Follow these steps if you are doing a Rails upgrade.