0.0.7 • Published 2 years ago

@dthung1602/sqss v0.0.7

Weekly downloads
-
License
WTFPL
Repository
github
Last release
2 years ago

Contributors Forks Stargazers Issues WTFPL License NPM TypeScript

What is this?

But why?

Why not?

After all Cascading Server Sheets is a real thing, you know.

Getting Started

<!-- To use the latest version-->
<script src="https://unpkg.com/@dthung1602/sqss/dist/bundle/index.js"></script>

<!-- Or to specify a version -->
<script src="https://unpkg.com/@dthung1602/sqss@<version go here>/dist/bundle/index.js"></script>

<!-- `transpileSQSSToCSS` is now available in your global scope!-->
<!-- To add style to your website, use the following snippet-->
<script>
   const sqlString = `
        -- All of your styles go here
        UPDATE styles
        SET "background" = 'blue'
        WHERE class = 'target';
   `;
   
   const cssString = transpileSQSSToCSS(sqlString);
   document.head.innerHTML += `<style>${cssString}</style>`;
</script>
  • Or you can install from npm:
$ npm i @dthung1602/sqss
# or yarn
$ yarn add @dthung1602/sqss
  • To use it in your project, call the transpile function in your build script:
const sqss = require("@dthung1602/sqss");
const fs = require("fs");

const sqlString = fs.readFileSync("path/to/your/stylesheet.sql", "utf-8");
const cssString = sqss.transpileSQSSToCSS(sqlString);

fs.writeFileSync("path/to/your/build/folder/output.css", cssString);

TypeScript is supported

import { transpileSQSSToCSS } from "@dthung1602/sqss";
const css: string = transpileSQSSToCSS(`UPDATE styles SET color = 'blue' where id = 'target';`);

License

Distributed under the WTFPL License.

You just DO WHAT THE F*CK YOU WANT TO

Contributing

Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Duong Thanh Hung - dthung1602@gmail.com

Project Link: https://github.com/dthung1602/sqss

Acknowledgements

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago