
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Use plain JavaScript to write your CSS.
Inspired by the JS CSS talk at JSConf 2015, this POC was thrown together in a few hours between sessions. Let me know what you think and maybe we can make it usable at some points.
npm install js2css
'use strict';
var gulp = require('gulp');
var js2css = require('gulp-js2css');
gulp.task('default', function() {
return gulp.src('src/**/*.css.js')
.pipe(js2css())
.pipe(gulp.dest('dist'));
});
var js2css = require('./lib/js2css.js');
console.log(js2css({
body: {
color: 'red'
}
}));
function color() {
return 'red';
}
module.exports = {
'div': {
'color': color,
margin: 100,
background: ['jalla', 'moz-jalla', 'ie-jalla'],
'.header': {
'font-size': '12px',
'&.big': {
fontSize: '14px'
}
}
}
};
/*
div {
color: red;
margin: 100;
background: jalla;
background: moz-jalla;
background: ie-jalla;
}
div .header {
font-size: 12px;
}
div .header.big {
font-size: 14px;
}
*/
'use strict';
var themeColor = '#BADA55';
var textStyles = function(size) {
return {
color: themeColor,
fontSize: size + 'px',
lineHeight: size + 'px'
};
};
var coolPadz = function(pad) {
return {
paddingTop: pad * 0.6 + 'px',
paddingBottom: pad * 0.6 + 'px',
paddingLeft: pad + 'px',
paddingRight: pad + 'px',
};
};
var style = {
body: {
color: themeColor,
p: textStyles(16),
'.title': {
color: '#000',
coolPadz: 40
}
}
};
module.exports = {
styles: style,
mixins: {
coolPadz: coolPadz
}
};
/*
body {
color: #BADA55;
}
body .title {
color: #000;
padding-top: 24px;
padding-bottom: 24px;
padding-left: 40px;
padding-right: 40px;
}
body p {
color: #BADA55;
font-size: 16px;
line-height: 16px;
}
*/
js2css.mixins.myGlobalMixn = function(){}
The inspiration came from Parsha Pourkhomami's talk at JSConf 2015. Most of the code was ruthlessly stolen from this project: https://github.com/stolksdorf/Cssjs
FAQs
JS CSS Pre-processor
The npm package js2css receives a total of 0 weekly downloads. As such, js2css popularity was classified as not popular.
We found that js2css 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
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.