
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
cssx-framework
Advanced tools
A CSS driven web framework that compiles semi-standard CSS into HTML content + styles at runtime
CSSX is a web UI framework with file-path routing. You've heard of CSS-in-JS, and CSS pre/post-processors like SASS, LESS, and Tailwind - but now get ready for a whole new world of CSS driven development, with CSSX!
I built CSS because I thought it was an entertaining idea and would parallel the million JS frameworks that exist. It doesn't really have a purpose except to entertain and see if it was possible.
From the terminal, run npx create-cssx@latest
or npm create cssx@latest
, and follow the prompts to set up a basic template. From there run (npm | yarn | pnpm | bun) install
> (npm | yarn | pnpm | bun) start
to spin up the local dev environment.
As CSSX is a file-path route based framework, the default template expects each page to be a .cssx
file within a ./routes
directory. This can be updated by changing the directory path passed into the generateRoutes()
function in the app.js
file.
Any mixins or shared components that are setup can be stored however you like, and then referenced as imports (@import '{relative_path_to_file}';
) relative to the calling file.
.cssx
files have roughly the same format as a standard .css
file, but with some additional functions like mixins in order to provide functionality for shared component styling.
To render elements on the page, simply write the CSS you require, but include the element tag in the specificity of the class (ie. div.root
would render a div
element with the class root
). Any element attributes you wish to include can be added in the same format as CSS variables nested within the class definition.
In order to define nested elements, just nest the CSS class definitions under the appropriate parent, like you would structure regular CSS.
eg.
div.root {
color: red;
--title: Div Title;
--text: Some text;
button {
border-radius: 8px;
color: blue;
--onclick: alert('Button clicked!');
--text: Click me;
--type: button;
}
}
would become =>
<div class="root" title="Div Title">
Some text
<button onclick="alert('Button clicked!')" type="button">
Click me
</button>
</div>
with the stylesheet
div.root {
color: red;
button {
border-radius: 8px;
color: blue;
}
}
Mixins can be defined with the syntax below:
@mixin mixinName($param1: defaultValue1, $param2: defaultValue2) {
...
}
and referenced as an @include
statement: @include mixinName();
(For brevity, the parentheses can be omitted if empty @include mixinName;
)
Mixin parameters can be overridden when including in a component, but if defining overrides then all parameters must be defined - ie. either define all of them, or leave them empty. If not all parameters are to be overridden, then the value default
can be used as a placeholder: @include mixinName(default, overrideValue);
A mixin can either be defined as a full component, with the element definition at the top level:
@mixin standardButton($backgroundColor: lightgreen, $hoverColor: lightblue, $class: example, $borderRadius: 6px, $type: button) {
button {
background-color: $backgroundColor;
--borderRadius: $borderRadius;
--class: $class;
--type: $type;
&:hover {
background-color: $hoverColor;
}
}
}
div.root {
@include standardButton;
}
or just as the nested styles / attributes / children, depending how you wish to interact with them
@mixin standardButton($backgroundColor: lightgreen, $hoverColor: lightblue, $class: example, $borderRadius: 6px, $type: button) {
background-color: $backgroundColor;
--borderRadius: $borderRadius;
--class: $class;
--type: $type;
&:hover {
background-color: $hoverColor;
}
}
div.root {
button {
@include standardButton;
}
}
FAQs
A CSS driven web framework that compiles semi-standard CSS into HTML content + styles at runtime
The npm package cssx-framework receives a total of 5 weekly downloads. As such, cssx-framework popularity was classified as not popular.
We found that cssx-framework demonstrated a healthy version release cadence and project activity because the last version was released less than 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 flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.