Gathering detailed insights and metrics for gatsby-plugin-stylus-resources
Gathering detailed insights and metrics for gatsby-plugin-stylus-resources
Gathering detailed insights and metrics for gatsby-plugin-stylus-resources
Gathering detailed insights and metrics for gatsby-plugin-stylus-resources
Gatsby support for Stylus with resources (e.g. variables, mixins etc.)
npm install gatsby-plugin-stylus-resources
Typescript
Module System
Node Version
NPM Version
CSS (50.75%)
JavaScript (43.74%)
Stylus (4.9%)
Shell (0.61%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3 Stars
669 Commits
1 Forks
1 Watchers
32 Branches
4 Contributors
Updated on Dec 16, 2022
Latest Version
2.0.7
Package Id
gatsby-plugin-stylus-resources@2.0.7
Unpacked Size
12.98 kB
Size
4.78 kB
File Count
11
NPM Version
10.2.4
Node Version
18.18.2
Published on
Nov 16, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
22
This is an extended version of gatsby-plugin-stylus.
The only difference is the use of sass-resources-loader so you can use your shared variables & mixins across all .styl
files without manually importing them in each file.
Feel free to check out and run the example folder for detailed configuration.
⚠️ BREAKING CHANGE : v2 uses stylus-loader@5.x.x
which requires Webpack 5 minimun (included in Gatsby v3)
npm i gatsby-plugin-stylus-resources -d
or
yarn add gatsby-plugin-stylus-resources -D
npm i gatsby-plugin-stylus-resources@1.0.36 -d
or
yarn add gatsby-plugin-stylus-resources@1.0.36 -D
Create your file (or files) with resources :
1/* styles/config/mixins.styl */ 2 3flexbox($value = row) 4 display: flex 5 flex-direction: $value 6 7truncate($fontsize = 14px) 8 flexbox() 9 height: $fontsize + 4px 10 white-space: nowrap 11 overflow: hidden 12 text-overflow: ellipsis
Include the plugin in your gatsby-config.js
file :
1/* gatsby-config.js */ 2 3module.exports = { 4 plugins: [ 5 { 6 resolve: "gatsby-plugin-stylus-resources", 7 options: { 8 resources: ['./src/styles/config/mixins.styl', 'path/to/another/file.styl'], 9 }, 10 }, 11 ], 12}
⚠️ Do not include anything that will be actually rendered in CSS, because it will be added to every imported .styl
file.
1// in gatsby-config.js 2plugins: [`gatsby-plugin-stylus-resources`]
Using CSS modules requires no additional configuration. Simply prepend .module
to the extension. For example: App.styl
-> App.module.styl
.
Any file with the module
extension will use CSS modules.
This plugin has the same API as
stylus-loader, which
means you can add stylus plugins with use
:
1// in gatsby-config.js 2const rupture = require("rupture") 3 4module.exports = { 5 plugins: [ 6 { 7 resolve: "gatsby-plugin-stylus-resources", 8 options: { 9 use: [rupture()], 10 }, 11 }, 12 ], 13}
PostCSS is also included to handle some default optimizations like autoprefixing a and common cross-browser flexbox bugs. Normally you don't need to think about it, but if you'd prefer to add additional postprocessing to your Stylus output you can sepecify plugins in the plugin options
1// in gatsby-config.js 2plugins: [ 3 { 4 resolve: `gatsby-plugin-stylus-resources`, 5 options: { 6 postCssPlugins: [somePostCssPlugin()], 7 }, 8 }, 9]
Contributions are welcome ! See contributing guidelines
MIT
Copyright (c) 2019 Jimmy Beldone
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/8 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
124 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More