![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
A simple CSS preprocessor that interprets JavaScript
jsheets file
Jsheets is a CSS preprocessor that executes JavaScript. It also replaces function calls and variables inside CSS. A simple approach to CSS preprocessing.
$
ObjectInside CSS the whole $
object is availible to you. That's it.
div {
background: $.someColor;
}
include
With include
you can import files or directories to a jsheet. When you include a directory, it will search that directory for files with the jsheet
file extension. Its usage is straight forward:
include 'somefile.jsheet'
css()
With the css
function you can output css. So you can do:
css('div {display: block}')
Every file has it's own local scope. But the $
-object is global.
Because underscore is used in the project, I thought i'd pass it to the jsheets. There are also some helpers provided inside the $
object.
$.$
is a function that executes and returns what is passed to it. This can be usefull for math or sometimes you can use it to use variables in weird places. Example:
div {
width: $.$(100 * 30)px
/* WON'T WORK */
width: $.someWithem
/* WILL WORK */
width: $.$($.someWith)em
}
With extend
you can reuse css attributes. It has two methods: add
and that
. With add you create save a bunch of attributes under a name.
$.extend.add('roundbutton', '\
display: block;'
)
Then with extend.that
you can then reuse those attributes.
$.extend.that('roundbutton', '.dialogue__button')
$.extend.that('roundbutton', '.escape__button')
What is special about this function, is that it renders only one CSS block per extend.add
. So the above renders to:
roundbutton, .dialogue__button, .escape__button { display: block; }
On done is an array you can push functions to that get executed at the and of parsing a file. The return value of a onDone hook will get printed as CSS.
You cannot use braces inside of a call to $.$
. That's because the $
variables and functions are replaced using a mediocar RegEx.
With calc you can do calculations in css units. You pass it a string. It also does a printf-style replacement with %d
.
$.someVar = '4rem'
$.calc('%d / 2', $.someVar)
compilesTo
2rem
I'm pretty ok with the package as it stands right now. But there are a lot of things I plan to implement.
FAQs
A simple CSS preprocessor that interprets JavaScript
The npm package jsheets receives a total of 0 weekly downloads. As such, jsheets popularity was classified as not popular.
We found that jsheets 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.