-
Notifications
You must be signed in to change notification settings - Fork 334
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
Namespace all @functions and @mixin's #557
Conversation
src/globals/scss/helpers/_arrow.scss
Outdated
$square-root-of-three: 1.732; | ||
|
||
@return ($base / 2) * $square-root-of-three; | ||
} | ||
|
||
// Arrow mixin | ||
// govuk-shape-arrow mixin |
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.
Overly keen find and replacing throughout this doc block? 🙂
src/globals/scss/helpers/_arrow.scss
Outdated
@@ -58,6 +58,6 @@ | |||
border-width: $perpendicular $height $perpendicular 0; | |||
border-right-color: currentColor; // 2 | |||
} @else { | |||
@error "Invalid arrow direction: expected `up`, `right`, `down` or `left`, got `#{$direction}`"; | |||
@error "Invalid govuk-shape-arrow direction: expected `up`, `right`, `down` or `left`, got `#{$direction}`"; |
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.
Overly keen find and replacing here too.
src/globals/scss/tools/_iff.scss
Outdated
@@ -1,5 +1,5 @@ | |||
// Wrapper for Sass' built-in `if` function that does not require you to pass | |||
// a value for $if-false. | |||
@function iff($condition, $if-true) { | |||
@function govuk-iff($condition, $if-true) { |
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 wonder if this function is worth keeping given the intention was to have a shorter way of writing
if($important, !important, null)
and now this is:
govuk-iff($important, !important)
Happy to address this in a later PR though.
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.
happy to keep as iff
src/globals/scss/helpers/_arrow.scss
Outdated
// @param {Base} $base - Length of the triangle 'base' side | ||
// @param {Height} $height - Height of triangle. Omit for equilateral. | ||
@mixin arrow($direction, $base, $height: null) { | ||
@mixin govuk-shape-arrow($direction, $base, $height: null) { |
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're going to change the name of this to shape-arrow then can we update the filename to _shape-arrow.scss
too please?
To avoid breaking compilation when Frontend is imported into an existign app that uses custom functions or GOV.UK Elements or GOV.UK Frontend toolkit
3f4cc21
to
4768eee
Compare
updated |
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 to me too (meant to say that this morning) |
To avoid breaking compilation when Frontend is imported into an existing app that uses custom
functions or GOV.UK Elements or GOV.UK Frontend toolkit, as observed in user research.
May have gone a bit too far in namespacing all the things, but we can remove some.
Trello ticket: https://trello.com/c/B2tdqPg5/784-fix-em-function-conflict-with-govuk-elements