Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmrs committed May 5, 2019
1 parent 02b2ce1 commit 463273d
Show file tree
Hide file tree
Showing 91 changed files with 3,061 additions and 100 deletions.
68 changes: 68 additions & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

### Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

### Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

### Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

### Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

### `npm run build` fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
85 changes: 25 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,33 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
# Tachyons React App [WIP]

## Available Scripts
This extends create-react-app to include Tachyons implemented with emotion +
styled-system. If you're familiar with Tachyons and are interested in
css-in-js, this is hopefully a helpful project. Can be used for anything you'd
use create-react-app for. While Tachyons is light-weight by default, using css-in-js can
allow you to only send needed styles down the wire to the user. This if often under 4kb.

In the project directory, you can run:
## Getting going

### `npm start`
Clone the directory
```
```

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
Install dependencies
```
yarn
```

The page will reload if you make edits.<br>
You will also see any lint errors in the console.
Start the dev environment
```
yarn start
```

### `npm test`
## Elements
```
src/elements/
```
This folder contains html elements wired up to styled system. Scales
are defined and configurable in ```src/theme.js```

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
If you edit this you will see the style guide update on the home page

### `npm run build`

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

### Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

### Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

### Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

### Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

### `npm run build` fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
{
"name": "tachyons-react-app",
"name": "tachyons-styled-react",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "3.0.0"
"react-scripts": "3.0.0",
"@emotion/core": "^10.0.10",
"@emotion/styled": "^10.0.10",
"emotion-theming": "^10.0.10",
"react-dom": "^16.8.6",
"react-emotion": "^10.0.0",
"react-router-dom": "^5.0.0",
"styled-system": "^4.1.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Tachyons React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
34 changes: 14 additions & 20 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import React from 'react'
import { ThemeProvider } from "emotion-theming"
import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
import theme from './theme'
import Home from './pages/Home'
import Div from './elements/Div'

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
<ThemeProvider theme={theme}>
<Div style={{ fontFamily: theme.typefaces.sansSerif }}>
<Router>
<Route exact path='/' component={Home} />
</Router>
</Div>
</ThemeProvider>
);
}

export default App;
export default App
20 changes: 20 additions & 0 deletions src/components/Logo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions src/elements/A.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import styled from "@emotion/styled"
import Link from "next/link"

import {
space,
width,
maxWidth,
display,
alignItems,
justifyContent,
fontSize,
fontWeight,
textAlign,
color,
borders,
borderColor,
borderRadius
} from "styled-system"

const A = styled.a(
space,
width,
maxWidth,
display,
fontSize,
fontWeight,
textAlign,
color,
alignItems,
justifyContent,
borders,
borderColor,
borderRadius,
{
boxSizing: "border-box",
textDecoration: "none",
":hover": {
cursor: "pointer"
}
}
)

A.defaultProps = {
display: "inline-block",
bg: "transparent",
color: "gray.2",
cursor: "pointer"
}

Link.defaultProps = {
href: "#0"
}

export default ({ children, href, ...props }) => (
<Link href={href}>
<A {...props}>{children}</A>
</Link>
)
26 changes: 26 additions & 0 deletions src/elements/Abbr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import styled from "@emotion/styled"

import {
space,
width,
fontSize,
fontWeight,
textAlign,
color,
display
} from "styled-system"

const Abbr = styled.abbr(
space,
width,
fontSize,
fontWeight,
textAlign,
color,
display,
{}
)

Abbr.defaultProps = {}

export default Abbr
31 changes: 31 additions & 0 deletions src/elements/Address.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import styled from "@emotion/styled"
import {
space,
display,
width,
fontSize,
lineHeight,
textAlign,
color,
borders,
borderColor,
borderRadius,
} from 'styled-system'

const Address = styled.address(
space,
display,
width,
fontSize,
lineHeight,
textAlign,
color,
borders,
borderColor,
borderRadius,
{},
)

Address.defaultProps = {}

export default Address
Loading

0 comments on commit 463273d

Please sign in to comment.