Skip to content

Fetch up stream (as of 25-Jun-2022) #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build.js.map

Large diffs are not rendered by default.

25 changes: 15 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="Description" CONTENT="Easy online tool for transforming CSS into Facebook React style JSON. Great for copy/pasting without the translation errors.">
<link rel="preconnect" href="https://cdnjs.cloudflare.com">
<link rel="preconnect" href="https://adservice.google.com">
<link rel="preconnect" href="https://www.google-analytics.com">
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-dark.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>Convert Css to React Style JSON by staxmanade</title>
<style>
.sk-cube-grid {
Expand Down Expand Up @@ -79,14 +76,19 @@

<body>

<a href="https://github.com/staxmanade/CssToReactStyle" target="_blank"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
<a href="./" target="_blank">
<img alt="fork me link"
style="position: absolute; top: 0; right: 0; border: 0;"
src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub"
data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png">
</a>

<div id="container">

<div class="inner">

<header style="text-align:center;">
<img src="images/CssToReact-logo.svg" />
<img alt="CSS to React logo" style="max-width: 300px" src="images/CssToReact-logo.svg" />
</header>

<div id="loader">
Expand Down Expand Up @@ -123,7 +125,7 @@
</script>
</aside>

<section id="main"></section>
<main id="main"></main>

<div class="amazonAffilliate">
</div>
Expand Down Expand Up @@ -160,5 +162,8 @@
ga('send', 'pageview');

</script>

<script async src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" onload="new ClipboardJS('.copy-to-clipboard');"></script>

</body>
</html>
48 changes: 39 additions & 9 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Input extends React.Component {
}

render() {
return <textarea cols="40" rows="20" {...this.props} value={undefined} />;
return <textarea {...this.props} value={undefined} />;
}
}

Expand Down Expand Up @@ -87,19 +87,49 @@ export default class App extends React.Component {
}

render() {
var outputCssStyle = this.state.error ? {
"backgroundColor": "lightcoral"
} : null;
const textAreaStyles = {
width: "48%",
height: "300px"
};
const outputCssStyle = { ...textAreaStyles };
const inputCssStyle = { ...textAreaStyles };

if (this.state.error) {
outputCssStyle.backgroundColor = "lightcoral";
}

console.log('state', this.state);
var inputText = this.state.inputText;
var outputText = this.state.error || this.state.outputText;

return (
<div style={{"textAlign":"center"}}>
<Input ref='inputCss' placeholder="Type or paste CSS here..." onChange={this.inputTextUpdate} value={inputText} />
<textarea ref='outputCss' cols="40" rows="20" style={outputCssStyle} value={outputText} />
<br />
<input style={{"marginLeft": "266px"}} ref="useNewline" type="checkbox" onChange={this.update} /> Format
<div>
<div style={{"textAlign":"right"}}>
<button style={{"width": "70px"}} className="output-css-button copy-to-clipboard" data-clipboard-target="#outputCss">Copy to Clipboard</button>
<input
style={{"marginLeft": "15px"}}
aria-label="Format"
ref="useNewline"
alt="Formats the react JSON below."
type="checkbox"
onChange={this.update} />
<span style={{"marginRight": "10px"}}>Format</span>
</div>
<div style={{"textAlign":"center"}}>
<Input name="inputCss"
aria-label="Input CSS"
ref='inputCss'
placeholder="Type or paste CSS here..."
style={inputCssStyle}
onChange={this.inputTextUpdate}
value={inputText} />
<textarea id="outputCss"
aria-label="Output React JSON"
name="outputCss"
ref='outputCss'
style={outputCssStyle}
value={outputText} />
</div>
</div>
);
}
Expand Down
124 changes: 0 additions & 124 deletions stylesheets/github-dark.css
Original file line number Diff line number Diff line change
@@ -1,124 +0,0 @@
/*
The MIT License (MIT)

Copyright (c) 2015 GitHub, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

*/

.pl-c /* comment */ {
color: #969896;
}

.pl-c1 /* constant, markup.raw, meta.diff.header, meta.module-reference, meta.property-name, support, support.constant, support.variable, variable.other.constant */,
.pl-s .pl-v /* string variable */ {
color: #0099cd;
}

.pl-e /* entity */,
.pl-en /* entity.name */ {
color: #9774cb;
}

.pl-s .pl-s1 /* string source */,
.pl-smi /* storage.modifier.import, storage.modifier.package, storage.type.java, variable.other, variable.parameter.function */ {
color: #ddd;
}

.pl-ent /* entity.name.tag */ {
color: #7bcc72;
}

.pl-k /* keyword, storage, storage.type */ {
color: #cc2372;
}

.pl-pds /* punctuation.definition.string, string.regexp.character-class */,
.pl-s /* string */,
.pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */,
.pl-sr /* string.regexp */,
.pl-sr .pl-cce /* string.regexp constant.character.escape */,
.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */,
.pl-sr .pl-sre /* string.regexp source.ruby.embedded */ {
color: #3c66e2;
}

.pl-v /* variable */ {
color: #fb8764;
}

.pl-id /* invalid.deprecated */ {
color: #e63525;
}

.pl-ii /* invalid.illegal */ {
background-color: #e63525;
color: #f8f8f8;
}

.pl-sr .pl-cce /* string.regexp constant.character.escape */ {
color: #7bcc72;
font-weight: bold;
}

.pl-ml /* markup.list */ {
color: #c26b2b;
}

.pl-mh /* markup.heading */,
.pl-mh .pl-en /* markup.heading entity.name */,
.pl-ms /* meta.separator */ {
color: #264ec5;
font-weight: bold;
}

.pl-mq /* markup.quote */ {
color: #00acac;
}

.pl-mi /* markup.italic */ {
color: #ddd;
font-style: italic;
}

.pl-mb /* markup.bold */ {
color: #ddd;
font-weight: bold;
}

.pl-md /* markup.deleted, meta.diff.header.from-file */ {
background-color: #ffecec;
color: #bd2c00;
}

.pl-mi1 /* markup.inserted, meta.diff.header.to-file */ {
background-color: #eaffea;
color: #55a532;
}

.pl-mdr /* meta.diff.range */ {
color: #9774cb;
font-weight: bold;
}

.pl-mo /* meta.output */ {
color: #264ec5;
}

Loading