Skip to content
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

Merged
merged 2 commits into from
Feb 28, 2018
Merged

Conversation

kr8n3r
Copy link

@kr8n3r kr8n3r commented Feb 28, 2018

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

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-557 February 28, 2018 08:42 Inactive
$square-root-of-three: 1.732;

@return ($base / 2) * $square-root-of-three;
}

// Arrow mixin
// govuk-shape-arrow mixin
Copy link
Contributor

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? 🙂

@@ -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}`";
Copy link
Contributor

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.

@@ -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) {
Copy link
Contributor

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.

Copy link
Author

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

// @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) {
Copy link
Contributor

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?

igloosi added 2 commits February 28, 2018 09:33
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
@kr8n3r
Copy link
Author

kr8n3r commented Feb 28, 2018

updated

Copy link
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hannalaakso
Copy link
Member

Looks good to me too (meant to say that this morning)

@kr8n3r kr8n3r merged commit 244d3d4 into master Feb 28, 2018
@kr8n3r kr8n3r deleted the namespace-mixins-and-functions branch February 28, 2018 15:19
This was referenced Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants