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

stylus import support #9

Closed
leecade opened this issue Dec 9, 2016 · 3 comments
Closed

stylus import support #9

leecade opened this issue Dec 9, 2016 · 3 comments

Comments

@leecade
Copy link

leecade commented Dec 9, 2016

import './index.module.styl'

got error:

Cannot use styleName attribute without importing at least one stylesheet.
@jcdekoning
Copy link
Contributor

jcdekoning commented Dec 9, 2016

I am not sure if stylus is the same as sugarss (syntax seems quite the same). I made a PR (#10) which makes it possible to configure syntax parsers.

{
        "generateScopedName": "[name]__[local]",
        "filetypes": {
          ".sss": "sugarss"
        }
}

@gajus
Copy link
Owner

gajus commented Jan 6, 2017

Fixed in #10.

Thanks to @jcdekoning .

@gajus gajus closed this as completed Jan 6, 2017
@k1sul1
Copy link

k1sul1 commented Mar 15, 2018

It's possible to configure syntax parsers, but unfortunately Stylus doesn't work, because there isn't a PostCSS parser available for it.

SugarSS syntax is not the same. Maybe it is if you use Stylus without braces, but not using braces breaks the Stylus compiler way too easily with a cryptic error, indent based syntax is just not worth it. It's also not just braces, some may love their semicolons, the point is that Stylus is a very unopionated about syntax, so the parser also has to be like that.

I got an error with sugarss from the first line of my first styl file:

Module build failed: CssSyntaxError: /home/k1sul1/projects/redacted/src/index.styl:1:6: Unnecessary curly bracket

It doesn't look like it's happening: postcss/postcss#602 (comment)

As for me, I'm probably going to have to use SCSS instead of Stylus.

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

No branches or pull requests

4 participants