Global Variable not found on built in stylus-functions
See original GitHub issueHi,
I’m trying to switch from sass to stylus, but have a problem with built-in functions and global variables.
This is my style.styl:
// Variables / Helpers
@require "_components/_variables"
// Components
@require "_components/_base"
This is my _components/_variables.styl:
// Font Styles
main-font-size = 14px
main-font-size-large = 16px
main-line-height = 1.5
main-fonts = "Helvetica Neue", Helvetica, Arial, sans-serif
alt-fonts = "Helvetica Neue", Helvetica, Arial, sans-serif
// Layout
screen-sm = 480px
screen-md = 768px
screen-lg = 960px
screen-xl = 1220px
// Theme
primary-color = #ff0
main-color = #333
And this my _components/_base.styl:
[...]
a
color primary-color
&:hover,
&:focus,
&:active
color: darken(primary-color, 10)
Until I come to the last part with the darken-function, everything wors just fine, but on darken it says:
[15:47:37] gulp-notify: [Error running Gulp] Error: /HTML5/node_modules/gulp-stylus/node_modules/stylus/lib/functions/index.styl:128:38
124|
125| // darken by the given amount
126|
127| darken(color, amount)
128| adjust(color, 'lightness', - amount)
---------------------------------------------^
129|
130| // lighten by the given amount
131|
TypeError: expected rgba or hsla, but got ident:primary-color
at "&:hover" (/HTML5/src/stylus/_components/_base.styl:35:22)
at "a" (/HTML5/src/stylus/_components/_base.styl:32:124)
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Python Global Variables - Not Defined? - Stack Overflow
I'm running into an issue where a global variable isn't "remembered" after it's modified in 2 ...
Read more >Global variables - IBM
A built-in global variable is part of the database management system, and is available to any SQL statement that runs on the database...
Read more >A Future for R: Common Issues with Solutions
Issues with globals and packages. Missing globals (false negatives). If a global variable is used in a future expression that conditionally overrides this ......
Read more >Global keyword in Python - GeeksforGeeks
It is used to create global variables in Python from a non-global scope, i.e. inside a function. Global keyword is used inside a...
Read more >Python Variable Scope (With Examples) - Programiz
In this tutorial, we'll learn about Python Global variables, Local variables, and Nonlocal variables with the help of examples.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
my fav pre proc!
@QuantumInformation yep.