├── .travis.yml ├── .npmignore ├── docs ├── logo.png ├── system.js ├── Link.js ├── theme.js ├── Pre.js ├── Heading.js ├── Box.js ├── Text.js ├── Button.js ├── Logo.js ├── App.js └── index.html ├── test.js.snap ├── .gitignore ├── .babelrc ├── LICENSE.md ├── package.json ├── src └── index.js ├── test.js ├── test.js.md └── README.md /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 9.0 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | docs 2 | .nyc_output 3 | coverage 4 | test.js* 5 | -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jxnblk/axs/HEAD/docs/logo.png -------------------------------------------------------------------------------- /test.js.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jxnblk/axs/HEAD/test.js.snap -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .nyc_output 2 | coverage 3 | dist 4 | package-lock.json 5 | yarn-lock.json 6 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "env", 4 | "stage-0", 5 | "react" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /docs/system.js: -------------------------------------------------------------------------------- 1 | import objss from 'objss' 2 | 3 | const system = (...funcs) => props => funcs 4 | .map(func => func(props)) 5 | .filter(obj => obj !== null) 6 | .map(objss) 7 | .join('') 8 | 9 | export default system 10 | -------------------------------------------------------------------------------- /docs/Link.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Base from '../src' 3 | 4 | const Link = props => 5 | 12 | 13 | export default Link 14 | -------------------------------------------------------------------------------- /docs/theme.js: -------------------------------------------------------------------------------- 1 | const theme = { 2 | fontSizes: [ 3 | 12, 16, 20, 24, 32, 48, 64, 96, 128 4 | ], 5 | space: [ 6 | 0, 4, 8, 16, 32, 64, 128, 256 7 | ], 8 | colors: { 9 | black: '#000', 10 | blue: '#07c' 11 | } 12 | } 13 | 14 | export default theme 15 | -------------------------------------------------------------------------------- /docs/Pre.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Text from './Text' 3 | 4 | const Pre = props => 5 | 15 | 16 | export default Pre 17 | -------------------------------------------------------------------------------- /docs/Heading.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Text from './Text' 3 | 4 | const Heading = props => 5 | 16 | 17 | export default Heading 18 | -------------------------------------------------------------------------------- /docs/Box.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Base from '../src' 3 | import { width, space, color } from 'styled-system' 4 | import { withTheme } from 'theming' 5 | import system from './system' 6 | 7 | const Box = withTheme(props => 8 | 15 | ) 16 | 17 | export default Box 18 | -------------------------------------------------------------------------------- /docs/Text.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Base from '../src' 3 | import { fontSize, fontWeight, space, color } from 'styled-system' 4 | import { withTheme } from 'theming' 5 | import system from './system' 6 | 7 | const Text = withTheme(props => 8 | 16 | ) 17 | 18 | export default Text 19 | -------------------------------------------------------------------------------- /docs/Button.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Base from '../src' 3 | import { withTheme } from 'theming' 4 | 5 | const Button = withTheme(({ theme, ...props }) => 6 | 27 | ) 28 | 29 | export default Button 30 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | # The MIT License (MIT) 3 | Copyright (c) 2016 – 2017 Brent Jackson 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | 11 | -------------------------------------------------------------------------------- /docs/Logo.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Base from '../src' 3 | 4 | const M = 'M' 5 | const L = 'L' 6 | 7 | const a = 2 // edge offset 8 | const b = 8 - a 9 | const c = 16 - a // outer edge offset 10 | const base = 12.5 11 | const tri = [ 12 | M, a, base, L, c, base, 13 | L, 8, base - b * Math.sqrt(3), 14 | 'z' 15 | ].join(' ') 16 | 17 | const rad = deg => Math.PI * deg / 180 18 | const H = (c - a) * 2/4 19 | const A = Math.cos(rad(30)) * H 20 | const B = Math.sin(rad(30)) * H 21 | 22 | const shiftx = n => n + A 23 | const shifty = n => n + B 24 | const handle = [ 25 | M, shiftx(a), shifty(base), 26 | L, shiftx(8), shifty(base) - b * Math.sqrt(3) 27 | ].join(' ') 28 | 29 | const Logo = ({ 30 | size = 768, 31 | color = 'currentcolor', 32 | ...props 33 | }) => 34 | 47 | 48 | 49 | 50 | 51 | export default Logo 52 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "axs", 3 | "version": "4.0.0-1", 4 | "description": "Stupid simple style components for React", 5 | "main": "dist/index.js", 6 | "module": "dist/index.es.js", 7 | "scripts": { 8 | "prepublish": "babel src -d dist && babel src/index.js -o dist/index.es.js --no-babelrc --presets=stage-0,react", 9 | "start": "x0 dev docs/App.js -o", 10 | "build": "x0 build docs/App.js --static -d docs", 11 | "logo": "repng docs/Logo.js -w 768 -h 768 -o docs -f logo", 12 | "size": "npm run prepublish && bundlesize", 13 | "cover": "nyc report --reporter=html --reporter=lcov", 14 | "test": "nyc ava" 15 | }, 16 | "keywords": [ 17 | "react", 18 | "react-component", 19 | "style", 20 | "stylis", 21 | "ui", 22 | "css", 23 | "css-in-js" 24 | ], 25 | "author": "Brent Jackson", 26 | "license": "MIT", 27 | "devDependencies": { 28 | "@compositor/x0": "^3.0.2", 29 | "ava": "^0.24.0", 30 | "babel-cli": "^6.26.0", 31 | "babel-preset-env": "^1.6.1", 32 | "babel-preset-react": "^6.24.1", 33 | "babel-preset-stage-0": "^6.24.1", 34 | "babel-register": "^6.26.0", 35 | "bundlesize": "^0.15.3", 36 | "nyc": "^11.4.1", 37 | "objss": "^1.0.3", 38 | "react-test-renderer": "^16.2.0", 39 | "repng": "^1.0.1", 40 | "styled-system": "^1.1.1", 41 | "theming": "^1.3.0" 42 | }, 43 | "dependencies": { 44 | "html-tags": "^2.0.0", 45 | "prop-types": "^15.6.0", 46 | "react": "^16.2.0", 47 | "stylis": "^3.4.5" 48 | }, 49 | "ava": { 50 | "require": [ 51 | "babel-register" 52 | ], 53 | "babel": "inherit" 54 | }, 55 | "bundlesize": [ 56 | { 57 | "path": "src/index.js", 58 | "maxSize": "0.8 kb" 59 | }, 60 | { 61 | "path": "dist/index.js", 62 | "maxSize": "1.8 kb" 63 | } 64 | ] 65 | } 66 | -------------------------------------------------------------------------------- /docs/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { ThemeProvider } from 'theming' 3 | import Base, { Style } from '../src' 4 | import theme from './theme' 5 | 6 | import Box from './Box' 7 | import Logo from './Logo' 8 | import Heading from './Heading' 9 | import Text from './Text' 10 | import Pre from './Pre' 11 | import Button from './Button' 12 | import Link from './Link' 13 | 14 | const App = props => ( 15 | 16 | 17 | Axs 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |

Axs

Stupid simple style components for React
npm i axs
GitHub
const Heading = props =>
12 |   <Base.h2 {...props} css='color:tomato;' />
13 | 14 | 15 | -------------------------------------------------------------------------------- /test.js.md: -------------------------------------------------------------------------------- 1 | # Snapshot report for `test.js` 2 | 3 | The actual snapshot is saved in `test.js.snap`. 4 | 5 | Generated by [AVA](https://ava.li). 6 | 7 | ## Base.reset() clears cache 8 | 9 | > Snapshot 1 10 | 11 | [ 12 |