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

Unknown word error #2

Open
Gitoffthelawn opened this issue Feb 9, 2021 · 2 comments
Open

Unknown word error #2

Gitoffthelawn opened this issue Feb 9, 2021 · 2 comments

Comments

@Gitoffthelawn
Copy link

  • Browser: Firefox 85
  • Operating System: Win7
  • Stylus Version: 1.5.15

Thank you for the new version of Stylus! This issue was present in the previous version, and is still present in v1.5.15:

The following code generates an "Unknown word" error at position 11:20. Likely an issue with Stylelint. Could be an issue with my code, but it works as expected, so I'm thinking this issue is with Styelint or Stylus..

/* ==UserStyle==
@name			Test001
@namespace		Test001
@version		1.0.0
@description		Test001
@author			Test
@preprocessor		less
@var			range hue-rotate "Hue-rotate" [0, 0, 359, 1]
==/UserStyle== */

@hue-rotate-deg: @{hue-rotate}deg;

img { filter: hue-rotate(@hue-rotate-deg) }
@tophf tophf transferred this issue from openstyles/stylus Feb 9, 2021
@tophf
Copy link
Member

tophf commented Feb 9, 2021

@eight04, looks like the only solution is to use postcss-less per stylelint documentation - could you take a quick look if this something we can do here while building the bundle or is it something that we can add to Stylus (in which case the issue should be transferred back)? I've already verified that adding the var definition for hue-rotate doesn't help, the problem is the syntax itself.

@eight04
Copy link
Collaborator

eight04 commented Feb 9, 2021

Stylelint itself can only parse vanilla CSS. To make it work with less/stylus-lang, we need plugins like postcss-less/postcss-styl.

It seems that it shouldn't be hard to include plugins with browserify:
https://github.com/postcss/postcss#browser
https://github.com/stylelint/stylelint/blob/master/docs/user-guide/usage/postcss-plugin.md#example-a

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