You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

cssx-framework

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cssx-framework

A CSS driven web framework that compiles semi-standard CSS into HTML content + styles at runtime

0.0.10
Source
npmnpm
Version published
Weekly downloads
29
16%
Maintainers
1
Weekly downloads
 
Created
Source

Overview

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!

Why?

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.

Structure

.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;
    }
}

Keywords

cssx

FAQs

Package last updated on 15 Apr 2024

Did you know?

Socket

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.

Install

Related posts