Closed cmalven closed 6 years ago
Also noticed that the resulting _variables.scss
gets the indentation for the file wrong, which causes styleLint to go crazy with indentation linting errors.
I'm willing to take this, #146, #148, and #152 if everyone is okay with moving back to EJS parsing of stylesheet files. These are the only issues currently blocking me from starting to test v2 for actual project work.
I don't have a strong opinion on parsing stylesheet files. I'm ok with ejs. @brianjhanson, thoughts?
I mostly don't like it from an aesthetic point of view (screws up syntax highlighting and in order to get indentation right you have to format it weird), but those are pretty minor complaints, so I'm fine with it.
@brianjhanson I'm with you. I wish it was nicer. But it is the only officially supported templating language for Yeoman, and I think there are some EJS features we can use to make the indentation thing less of an issue.
generators/styles/templates/main.scss
is actually an EJS template expecting to get passed an object that describes thedeps
for the project. Currently that object is not being passed in – we're not even actually usingcopyTpl
to copy the file – so it gets copied over to the project with all of the EJS still intact. Not good.As a related aside…
I think we should be continuing to parse this file as EJS, and I think we should be doing the same with the
_variables.scss
file that we're currently populating by appending chunks to the file from a JSON file (https://github.com/onedesign/generator-one-base/blob/feature/base-generator-v2/generators/styles/index.js#L67). The approach we're currently using for_variables.scss
is more difficult to comprehend and most importantly it makes actually updating that SCSS more cumbersome. I don't think anybody loves having EJS in their SCSS, but its better than this. At the very least, we should be appending the individual pieces of the_variables.scss
file from.scss
templates, not from a.js
config file. I think we want as little separation between the template source files in the generator and the final files that are output, otherwise its confusing and will discourage people from working with those files.