
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
inline-sass
Advanced tools
[](https://badge.fury.io/js/inline-sass) [](https://nodejs.org/api/esm.html)
Inline Sass stylesheets into HTML style attributes — useful in emails and other lo-fi HTML authoring situations.
A thin wrapper for inline-css and Sass.
file.html:
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<link rel="stylesheet" href="sass.scss" />
</head>
<body>
<div id="ex">Hello world</div>
</body>
</html>
sass.scss:
#ex {
color: red;
}
import inlineSass from 'inline-sass';
inlineSass('/path/to/file.html')
.then((result) => console.log(String(result)))
.catch(console.error);
Console:
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
<div id="ex" style="color: red;">Hello world</div>
</body>
</html>
Passes through all arguments to inline-css. Plus:
Type: boolean
Default: true
Whether or not to delete the temporary directory of transpiled CSS.
inline-sass transpiles any linked .sass or .scss files into a temporary directory, re-writing the <link> tags in the HTML to refer to the temporary .css files (but storing the original href in the data-original-href attribute). At the end of the run, the temporary directory is deleted. Unless overridden by another value, the directory containing the HTML file will be passed as the url option to inline-css.
It is also possible to pass literal HTML as the first argument to inline-sass, in which case the options object must contain an url value to act as a basepath for any relative references in the <link> tags:
import inlineSass from `inline-sass`;
inlineSass(
`<html>
<head
<title>Literal HTML</title>
<link rel="stylesheet" href="styles/sass.scss"/>
</head>
<body>
<div id="ex">Hello World</div>
</body>
</html>`,
'file:///path/to/my'
)
.then(result => console.log(String(result)))
.catch(console.error);
In this case, Sass would attempt to transpile the file /path/to/my/styles/sass.scss. A concrete example of this approach can be found in @battis/inline-sass-to-clipboard.
FAQs
[](https://badge.fury.io/js/inline-sass) [](https://nodejs.org/api/esm.html)
The npm package inline-sass receives a total of 1 weekly downloads. As such, inline-sass popularity was classified as not popular.
We found that inline-sass 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.