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

Comments in @import-ed files are being inappropriately suppressed #1389

Closed
vitormil opened this Issue Feb 17, 2014 · 5 comments

Comments

Projects
None yet
6 participants
@vitormil

vitormil commented Feb 17, 2014

In @imported .styl files, all block comments are being suppressed in the output.

There's a closed issue for that https://github.com/LearnBoost/stylus/issues/444 from 2 years ago but It's still not working.

I've created a repo to show this scenario:
https://github.com/vitormil/stylus-comment-bug

@Panya

This comment has been minimized.

Show comment
Hide comment
@Panya

Panya Feb 17, 2014

Member

This is done on purpose. As said in #935:

In order to prevent comments from existing plugins and libraries (like Nib) from being compiled, suppressed comments (without '!') are ignored.

Member

Panya commented Feb 17, 2014

This is done on purpose. As said in #935:

In order to prevent comments from existing plugins and libraries (like Nib) from being compiled, suppressed comments (without '!') are ignored.

@dpanov

This comment has been minimized.

Show comment
Hide comment
@dpanov

dpanov Mar 7, 2014

Guys, this is really causing problems when a documentation like Kalei (http://kaleistyleguide.com/) is used. It uses comments in order to generate a style documentation. In my case, I use Grunt to generate two files. One of the files is compressed and doesn't have comments - this is the file that gets loaded on the website. The second CSS file is not compressed and it has comments. The style guide reads the uncompressed file and builds a documentation from it.

It's not acceptable to use suppressed comments, because they will appear in the compressed file as well.

dpanov commented Mar 7, 2014

Guys, this is really causing problems when a documentation like Kalei (http://kaleistyleguide.com/) is used. It uses comments in order to generate a style documentation. In my case, I use Grunt to generate two files. One of the files is compressed and doesn't have comments - this is the file that gets loaded on the website. The second CSS file is not compressed and it has comments. The style guide reads the uncompressed file and builds a documentation from it.

It's not acceptable to use suppressed comments, because they will appear in the compressed file as well.

@riemerio

This comment has been minimized.

Show comment
Hide comment
@riemerio

riemerio Mar 1, 2016

Is there a working solution without explicitly mark comments like /*! */ ?
Like @dpanov I am working with the sc5 styleguide where I urgently need comments from imported/required .styl files for my styleguide documentation.

The problem with /*! */ is that the stylus compiler can't remove them in further build tasks for production. So I need another CSS minifier to remove the persisted comments.

I would suggest an additional build flag to remove persisted comments /*! */ as well if it is needed.

riemerio commented Mar 1, 2016

Is there a working solution without explicitly mark comments like /*! */ ?
Like @dpanov I am working with the sc5 styleguide where I urgently need comments from imported/required .styl files for my styleguide documentation.

The problem with /*! */ is that the stylus compiler can't remove them in further build tasks for production. So I need another CSS minifier to remove the persisted comments.

I would suggest an additional build flag to remove persisted comments /*! */ as well if it is needed.

@codyroot

This comment has been minimized.

Show comment
Hide comment
@codyroot

codyroot Mar 1, 2016

I agree on Markus suggestion.

codyroot commented Mar 1, 2016

I agree on Markus suggestion.

@bruvvn

This comment has been minimized.

Show comment
Hide comment
@bruvvn

bruvvn commented Apr 5, 2016

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment