This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
import styled from "styled-components" | |
// Simple form component | |
const Input = styled.input` | |
background: green | |
` | |
const FormWrapper = () => <Input placeholder="hola" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styled from "styled-components"; | |
import { | |
theme | |
} from "ui"; | |
const { color, font, radius, transition } = theme; | |
export const Button = styled.button` | |
background-color: ${color.ghost}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
import Button from "components/core/button" | |
const = Component = () => <Button theme={ Button.theme.secondary }>Some Button</Button> | |
export default Component |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import '~tools/theme'; | |
:local(.root) { | |
border: 1px solid; | |
font-family: inherit; | |
font-size: 12px; | |
color: inherit; | |
background: none; | |
cursor: pointer; | |
display: inline-block; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body class="scenery"> | |
<section class="scenery__sky"> | |
<div class="sky [sky--dusk / sky--daytime] [sky--foggy]"> | |
<div class="sky__clouds"></div> | |
<div class="sky__sun"></div> | |
</div> | |
</section> | |
<section class="scenery__ground"></section> | |
<section class="scenery__people"></section> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prop passing Shorthands for Styled-components | |
export const borderProps = props => css` | |
${props.borderBottom && `border-bottom: ${props.borderWidth || "1px"} solid ${color.border}`}; | |
${props.borderTop && `border-top: ${props.borderWidth || "1px"} solid ${color.border}`}; | |
${props.borderLeft && `border-left: ${props.borderWidth || "1px"} solid ${color.border}`}; | |
${props.borderRight && `border-right: ${props.borderWidth || "1px"} solid ${color.border}`}; | |
`; | |
export const marginProps = props => css` | |
${props.marginBottom && `margin-bottom: ${typeof (props.marginBottom) === "string" ? props.marginBottom : "1em"}`}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
# author: perezpriego | |
# This shell script creates the basic architecture of a react-component | |
mkdir -p $1 | |
cd $1 | |
touch styles.scss index.jsx | |
cat > index.jsx <<DELIM | |
import React from "react"; | |
import styles from "./style"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
import React from "react"; | |
import styles from "./style"; | |
class ${1:Component} extends React.Component { | |
constructor(props) { | |
super(props); | |
} |