Coder Social home page Coder Social logo

jaandrle / jaacss-cli Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 219 KB

EXPERIMENT – Helper for managing atomic CSS (functional CSS/utility-first CSS)

License: MIT License

JavaScript 100.00%
atomic-css functional-css utility-first cli no-dependencies nodejs css

jaacss-cli's Introduction

jaaCSS-cli

Warning: WIP and for now mainly experiment

Overview

This is command line (terminal) tool for managing functional (atomic) CSS clases. You can “connect” the script with CSS/SASS file by node jaaCSS.js -I file_path (on unix-like systems works without 'node ').

It opens interactive promt with typical usage:

? marginR
+ marginR__2
? fontS__1
- fontS__1
+ fontS__1d5

…in you web page, you wanted some right margin – so, you ask for already used margins, yet you decide to use new one. Analogously for font size.

More info for now only in source code ./src.

Example files

Modified files should look like:

CLI help

main

  [email protected]
  EXPERIMENT – Helper for managing functional CSS classes
  Usage: jaaCSS --[cmd] [param]
    …cmd: help, init, html, interactive, eval
    …param: Based on cmd

  Help:
    Commands:
      --help|-h
        Shows this text
      --init css_like_file
        Creates inital file structure with `jaaCSS` section
        The section is separated by comments `/* jaaCSS:start/end */`
        This command/step can be ommited,
        the `-I` will do it itself, if the section doesn’t exists.
      --html html_like_file
        [WIP] Show classes from HTML
      --interactive|-I css_like_file
        Interactive shell for manipulating with `jaaCSS` section.
        With prefixes +/- you can add/remove styles from file (e.g. `+ fontS__1`).
        With prefix '?' you can filter existing rules.
        Using 'q' quits shell and program.
        Without prefixes it works as `--eval`.
      --eval value_c
        Just console log conversion
    Params:
      css_like_file
        CSS (like) file
      html_like_file
        HTML (like) file
      value_c
        The value part for evaluing in the form:
          - `property: value;` …or
          - `property__value`

interactive mod

node jaaCSS.js "-I" "example.css"

  [email protected]
  EXPERIMENT – Helper for managing functional CSS classes
  Usage: jaaCSS --[cmd] [param]
    …cmd: help, init, html, interactive, eval
    …param: Based on cmd

  Interactive shell
  q: Quit interactive shell
   : Just echo full rule (e.g. `fontS__1`)
  ?: Searching registered rules (e.g. `? fontS`)
  +: Add rule to the file (e.g. `+ fontS__1`)
  -: Remove rule to the file (e.g. `- fontS__1`)
  !: Add rule by full recepy (e.g. `! color__urgent { color: red; }`
  =: [WIP] Compare classes in CSS like file and HTML like one (`>` only in CSS | `<` only in HTML)
  @: Converting class names (for example from HTML) to the CSS rules/SASS includes.
  just write anything to converse or start line with: q/ /?/+/-/!/=/@

jaacss-cli's People

Contributors

jaandrle avatar

Watchers

 avatar  avatar

jaacss-cli's Issues

pipeaccept_

function pipeaccept_(){ return new Promise(function(resolve){
	let data= "";
	process.stdin.resume();
	process.stdin.setEncoding('utf8');
	process.stdin.on('data', chunk=> data+= chunk);
	process.stdin.on('end', ()=> (process.stdin.pause(), resolve(data) ));
}); }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.