GithubHelp home page GithubHelp logo

gnat / stylus-inline Goto Github PK

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

Zero build step version of Stylus CSS that runs in your browser. With inlined scopes! Written in vanilla JS. Also single file python version!

License: MIT License

HTML 60.86% Python 39.14%
css inline-css inline-styles stylus stylus-css transpiler compiler indentation-parsing offside-rule whitespace

stylus-inline's Introduction

๐Ÿช„ Stylus CSS Inline

For fun prototype based on css-scope-inline. Unsure if development will continue, but if anyone wants to borrow ideas or code.. here you go. Made to work like Stylus CSS originally concieved by TJ Holowaychuk of Express.js fame.

With new CSS Nesting, hsl() syntax differences, true CSS variables: classic Stylus is beginning to diverge too greatly with vanilla CSS. It's time to leave! This project may be an option for you.

2023 it may also be best to seriously consider vanilla CSS.

๐Ÿ Python Version (stylus.py)

  • Most reliable version since it generates main.css for you to load normally.
  • This version is a bit more complete and robust than the Javascript one.

โ˜• Javascript Version (stylus.html)

  • Runs in the browser automatically!
  • Works inside inline scoped <stylus>!
  • Syntax highlighting in Sublime works!
  • ๐ŸŸ  Idea of external stylus in real time has issues.
    • Browser removes invalid CSS from <link> and @import() making those paths invalid for processing.
      • Requires loading via custom JS function to work. Might or might not be worth it?
        • Could load via stylus('/css/main.css') and inline <script> at top? Meh.

๐Ÿ‘€ Before you adopt.

I realise Stylus is amazing but.. you lose the ability to inline a ton of styles at once in a single line. Sure, you save { and } but you gain verbosity elsewhere (unless of course you always add a new line for each style anyway!) May not be worthwhile to use this code depending on what patterns you currently enjoy using.

stylus-inline's People

Contributors

gnat avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.