-
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
Vendor-in SassMQ functionality, write tests and remove external dependency #657
Conversation
Not great to vendor but I imagine we won't really need to update this, so seems good to me. Would be good to include a comment in the file that explains it's vendored, and what version it is based on. |
added the comment about where its vendored from and version |
// the current breakpoint from being included multiple times. | ||
// | ||
// the current breakpoint from being included multiple times. | ||
// | ||
// We can't use the `exports` mixin for this because import directives cannot be |
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 but if we vendor this is this hack necessary any more? @36degrees
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.
No, not if we wrap the whole of sass-mq in an exports
.
// the current breakpoint from being included multiple times. | ||
// | ||
// the current breakpoint from being included multiple times. | ||
// | ||
// We can't use the `exports` mixin for this because import directives cannot be |
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.
No, not if we wrap the whole of sass-mq in an exports
.
@@ -11,6 +11,6 @@ $sass-mq-already-included: false !default; | |||
$mq-show-breakpoints: (); | |||
} | |||
|
|||
@import "./node_modules/sass-mq/mq"; | |||
@import "../tools/sass-mq"; |
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.
It seems unnecessary to split media queries across these two layers… and because sass-mq 'outputs' CSS (even if it is just breakpoints) it would make more sense in here. Would suggest just moving sass-mq in here and using exports
to simplify the hack as @NickColley identified.
updated with comments by @NickColley and @36degrees |
There are a number of scenarios where assuming the sass-mq dependency lives in the same project breaks that have been outlined in #636. As Sass does not allow dynamic imports we cannot provide a variable to override path to sass-mq stylesheet. To fix this and avoid external dependencies of Frontend, we've moved the functionality into the project.
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.
It's regrettable to vendor but helps @penx out so 👍
There are a number of scenarios where assuming the sass-mq dependency lives in the same project breaks that have been outlined in #636.
As Sass does not allow dynamic imports we cannot provide a variable to override path to sass-mq stylesheet.
To fix this and avoid external dependencies of Frontend, we've moved the functionality into the project, wrote tests for its mixins and functions and remove dependency from package.json