
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
grunt-inlinestyles
Advanced tools
A Grunt plugin to inline a selected CSS file. Ideal for inlining critical CSS.
This will take a HTML stylesheet link and inline the target CSS.
This means that:
<link rel="stylesheet" href="/css/stylesheet.css" data-inline="true">
will become:
<style>h1{font-style:italic}</style>
This module does not inline javascript, images or fonts.
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-inlinestyles --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-inlinestyles');
In your project's Gruntfile, add a section named inlinestyles
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
inlinestyles: {
options: {
// Task-specific options go here.
basepath: './',
minify: true,
tag: '[data-inline="true"]'
},
your_target: {
// Target-specific file lists and/or options go here.
files: {
'destination.html': 'source.html'
}
},
},
})
Type: String
Default value: 'process.cwd()'
A string value that is used to indicate the root of your website. 'Absolute' CSS links are relative to this value.
Type: boolean
Default value: true
A boolean that is used to turn minification of the inlined CSS on or off.
Type: String
Default value: '[data-inline="true"]'
A string value that is used to designate a CSS link that is to be inlined.
In this example, the default options are used to inline CSS inside source.html
. So if the source.html
file has the content <link rel="stylesheet" href="/css/stylesheet.css" data-inline="true">
the generated result would contain <style>h1{font-style:italic}</style>
grunt.initConfig({
inlinestyles: {
options: {},
files: {
'destination.html': 'source.html'
}
},
})
In this example, custom options are used to specify a new basepath, disable CSS minification and to add a new inlining tag.
grunt.initConfig({
inlinestyles: {
options: {
basepath: 'subpath',
minify: false,
tag: '[data-inlinethisstyle="true"]'
},
files: {
'destination.html': 'source.html'
}
},
})
Contributions are welcome! Hit me up via @sonniesedge
v0.0.1 Initial release
Copyright (c) 2014 . Licensed under the MIT license.
FAQs
Inline critical CSS into the HTML header
We found that grunt-inlinestyles 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.