Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@copoko/hexo-renderer-stylus
Advanced tools
Stylus renderer plugin for Hexo
Add support for Stylus with @copoko/nib and other plugins.
Prerequisites:
$ npm install @copoko/hexo-renderer-stylus --save
You can configure this plugin in _config.yml
.
stylus:
compress: false
sourcemaps:
comment: true
inline: true
sourceRoot: ''
basePath: .
plugins: '@copoko/nib'
false
)sourceMappingURL
to the generated CSS (default: true
)false
)sourceRoot
property of the generated sourcemap.
)@copoko/nib
)It is possible to set variables that can be used in Stylus. The purpose of setting variable is to avoid direct modification of the Stylus code, and thus to make themes more generic
For example, instead of hardcoding:
div
color #FFCC44
You can refer to a variable:
div
color convert(hexo-config("moody_red"))
And in your theme's configuration, you can define this variable:
moody_red: "#8B0001"
(The "convert" function above is here to convert the string into an actual stylus color)
You can also use the theme_config variable in the main _config.yml
:
theme_config:
moody_red: "#8B0001"
This plugin provide a filter stylus:renderer
to allows you extend it. When there's something you cannot do in Stylus, define it in JavaScript!
For example, to define some global variable:
hexo.extend.filter.register('stylus:renderer', function(style) {
style
// we may define a global variable by passing a `Node`
.define('has-canvas', require('stylus').nodes.false);
// stylus also casts JavaScript values to their Stylus equivalents when possible
.define('families', ['Helvetica Neue', 'Helvetica', 'sans-serif'])
// also allows you to provide a JavaScript-defined function to Stylus
.define('get-list', function(){
return ['foo', 'bar', 'baz'];
});
})
Save the file in "scripts/" folder and run Hexo as usual.
Notice: for more JavaScript api, refer to stylus's documentation.
FAQs
Stylus renderer plugin for Hexo
The npm package @copoko/hexo-renderer-stylus receives a total of 0 weekly downloads. As such, @copoko/hexo-renderer-stylus popularity was classified as not popular.
We found that @copoko/hexo-renderer-stylus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.