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

Compile partial sass files #104

Open
jorgenfb opened this issue Dec 13, 2013 · 5 comments
Open

Compile partial sass files #104

jorgenfb opened this issue Dec 13, 2013 · 5 comments
Assignees
Milestone

Comments

@jorgenfb
Copy link

I have a lot of css modules defined as partials (files starting with _). Styledocco generates the documentation page, but the preview iframe contains no styling. I think this is because the filename starts with a _. If I rename the files ( without leading _) then it includes the styling.

Compiling the partials and adding them to the preview would really help document my modules. I guess other have this problem as well, saving modules as partials seems to be good practice.

@ghost ghost assigned marrs Dec 13, 2013
@marrs
Copy link
Collaborator

marrs commented Dec 13, 2013

It sounds like a good idea. It may be a while before I can get around to this, so if you want to contribute this feature yourself, you can make a pull request against dev0.7.

@jorgenfb
Copy link
Author

At first the solutions seemed clear, just remove the check for sass/scss file beginning with _ at the beginning of the preprocess-function. This will include the partials, but if other files include these partials they are included multiple times. This may or may not be a problem, depending on order of concatenation.

The same problem already exist for files not starting with underscore, they appear multiple times if included in some other file.

The only solution that I can think of is analyzing all style files, looking for import statement and only preprocess files already not imported in other files.

I'm not sure this is worth continuing. I have been thinking and come to the conclusion that a styleguide should be based on your main style file, which should include all the modules your using.

What do you think @marrs ?

@marrs
Copy link
Collaborator

marrs commented Dec 16, 2013

I think you're right that documenting the main file is the right way to go. I wonder if this was considered by @jacobrask originally and that's why modules get ignored.

So it's probably best to leave it as is. I will need to add a spec to the tests to document this behaviour. I'm in the process of documenting all code for the 0.7 release so I'll close this ticket when that gets done.

Thanks for raising this behaviour and thinking through the problem.

@highvoltag3
Copy link

I agree with most of what @jorgenfb @marrs have mentioned here, yet I'm not 100% sure the solution is on leaving the as is and documenting all in the main file, the reason behind this is that if you're including third party libraries like Bourbon you don't want those to get process, so it's easier to just pass the files you want to actually include, bringing the original problem back.

I'm currently working on a project that includes Bournon, Neat, Normalize and Animate in the main file along with all the partials for the project and having all those files pass through Styledocco makes no since, not to mention that normalize.css comes heavily commented and those get build into the final style guide.

@highvoltag3
Copy link

After looking into this it's not as easy as just changing the method preprocess() though of course that would need to be done, but the real root cause of the issue is #124 since the common path between say:

/styles/sass/partials/_partial1.scss
/styles/sass/partials/_partial2.scss

is /styles/sass/partials/_ which is not a real path but fails silently.

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

No branches or pull requests

3 participants