-
Notifications
You must be signed in to change notification settings - Fork 335
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
Make override classes consistently verbose #786
Conversation
CHANGELOG.md
Outdated
@@ -153,6 +153,27 @@ Note: We're not following semantic versioning yet, we are going to talk about th | |||
|
|||
([PR #778](https://github.com/alphagov/govuk-frontend/pull/778)) | |||
|
|||
- Make override classes consistently verbose #786 |
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.
stray pr number
this needs updating
|
yaml and by extension readme files in radios
|
We've extended the shorthand 'f' to longhand 'font-size' and extended the shorthand 'w' to longhand 'font-weight' This changes the selectors from `.govuk-!-f-rN` to `.govuk-!-font-size-N`.
861b2a2
to
d9399d6
Compare
d9399d6
to
acd6638
Compare
For reviewers, I've been running the following in the review application var stylesheet = document.styleSheets[0]
var selectors = []
var rules = stylesheet.cssRules;
for (var i = 0; i < rules.length; i++) {
selectors.push(rules[i].selectorText);
}
selectors =
selectors
.filter(selector => selector)
.filter(selector => selector.startsWith('.govuk-\\!'))
.map(selector => selector.trim())
console.log(selectors.join('\n'), selectors.length) To check the before and after. |
acd6638
to
74052a3
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.
I think this looks really good, all the class names seem to be make sense and I haven't been able to find any visual differences in the review app.
Just noticed one comment that needs removing.
That script is handy 👍
src/overrides/_spacing.scss
Outdated
@@ -23,40 +23,39 @@ $_spacing-directions: ( | |||
/// indicates that. We might want to add non-responsive ones later. |
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.
The bit about "the 'r' before the scale point indicates that" just needs to come out.
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.
Good spot thanks Hanna
We've made the decision to remove the 'r' for responsive, this was hard to remember users found this confusing. We'll consider adding a '--fixed' modifier in the future if we require a static version of this override.
8bd452e
to
6c84380
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.
💯
In https://gist.github.com/nickcolley/f135e89ed4b679355b0ab47135b38ee8 I went over the current inconsistencies with our override classes.
The community was in favour of making these consistently verbose.
We've extended the shorthand 'f' to longhand 'font-size' and
extended the shorthand 'w' to longhand 'font-weight'
This changes the selectors from
.govuk-!-f-rN
to.govuk-!-font-size-N
.We've made the decision to remove the 'r' for responsive, this was hard to remember users found this confusing. (Closes #689)
We'll consider adding a '--fixed' modifier in the future if we require a static version of this override.
Override classes prior to this change (total of 118):
Override classes after this change (total 118):