This enables filtering of Sass files from the component directory into a file that you can then include in the app's scss file. Sass files will get dynamically added to it as you change the config for what components are included.
The last commit here shows how to use this and isn't meant to stay in for merge. I really just wanted to open this for discussion as I think moving Sass files to a folder that then gets filtered to a specific location is likely more straightforward.
Components also use structure via @use structure/.. directives.
During the build, components you have opted to include get their .scss files copied over to app/styles: https://github.com/hashicorp/structure/pull/5/files#diff-0703d2837081697b3b02d8cb1af3b972R64, and a file named structure-comonents is generated that @forwards each component sass file. Including @use structure-components in app.scss then includes all of the component styles in your app.
Questions:
Does this make sense?
Should component files get copied to the structure dir instead of app/styles?
If they do get copied to structure dir, does that make authoring strange because of the relative imports?
This enables filtering of Sass files from the component directory into a file that you can then include in the app's
scss
file. Sass files will get dynamically added to it as you change the config for what components are included.The last commit here shows how to use this and isn't meant to stay in for merge. I really just wanted to open this for discussion as I think moving Sass files to a folder that then gets filtered to a specific location is likely more straightforward.
The overview of how it works is this: Consuming apps can use the
structure
sass directly via https://github.com/simonexmachina/ember-cli-sass#alternative-addon-usage.Components also use structure via
@use structure/..
directives.During the build, components you have opted to include get their
.scss
files copied over to app/styles: https://github.com/hashicorp/structure/pull/5/files#diff-0703d2837081697b3b02d8cb1af3b972R64, and a file namedstructure-comonents
is generated that@forward
s each component sass file. Including@use structure-components
inapp.scss
then includes all of the component styles in your app.Questions: Does this make sense? Should component files get copied to the
structure
dir instead ofapp/styles
? If they do get copied tostructure
dir, does that make authoring strange because of the relative imports?