Giter VIP home page Giter VIP logo

csstoreact's Introduction

What is it?

Allows you to paste plain CSS into a <textarea>, it will automatically transform that into something you can copy right into a React component inline style.

See it in action: CssToReact

The story behind it...

So you're working on a React app. It's up and running in you're favorite browser but you notice an issue with some layout. You think, ok, this should be easy to fix. You open up the developer tools, hack on some CSS within the browser till you get it looking just the way you want it to. Maybe it's several CSS properties you added or tweaked so you copy each of them into the clipboard so you can transfer them back to your application.

Then you realize, these styles aren't coming from a CSS style sheet, they're in-line styles right in you're React component.

Now you're like, FINE, I'll manually translate this to React-style-inline-CSS. This is fine if you do it once, but maybe you missed removing a dash and mis-cased a letter or maybe you forgot a comma, or left a semicolon in the converted style translation… Never happened to you? Oh, you are so amazing if only I was as cool as you. For myself and probably another 1 or 2 of you out there I hacked together a little tool that automates this translation. Maybe this should be a plugin to my text editor where I can right click and say "Paste as React Style" instead, but for now it's a single simple little web page that will automate the translation for you.

So one night I was searching the React interwebs thinking someone had to have build this tool already. Unfortunately I didn't find it anywhere but I DID find this handy little tool raphamorim/native-css which is a CLI version of what I wanted in the browser. So thanks to the quick bootstrap based on that tool, I was able to put this little project together in just a short evening...

Hack on this repo

npm install
npm run dev

csstoreact's People

Contributors

staxmanade avatar tongrhj avatar

Watchers

 avatar Steve avatar James Cloos 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.