JSPM

  • Created
  • Published
  • Downloads 1619
  • Score
    100M100P100Q121232F
  • License MIT

Aesthetic is a powerful React library for styling components through the use of adapters.

Package Exports

  • aesthetic
  • aesthetic/lib/Adapter
  • aesthetic/lib/Aesthetic
  • aesthetic/lib/ThemeProvider
  • aesthetic/lib/UnifiedSyntax
  • aesthetic/lib/createStyler
  • aesthetic/lib/helpers/createStyleElement
  • aesthetic/lib/helpers/formatFontFace
  • aesthetic/lib/helpers/toArray
  • aesthetic/unified

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (aesthetic) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Aesthetic

Build Status

Aesthetic is a powerful React library for styling components, whether it be CSS-in-JS using style objects, importing stylesheets, or simply referencing external class names. Simply put, Aesthetic is an abstraction layer that utilizes higher-order-components for the compilation of styles via third-party libraries, all the while providing customizability, theming, and a unified syntax.

import React from 'react';
import PropTypes from 'prop-types';
import { StylesPropType } from 'aesthetic';
import withStyles, { classes } from '../path/to/styler';

function Button({ children, styles }) {
  return (
    <button type="button" className={classes(styles.button)}>
      {children}
    </button>
  );
}

Button.propTypes = {
  children: PropTypes.node.isRequire,
  styles: StylesPropType.isRequired,
};

export default withStyles(({ unit }) => ({
  button: {
    textAlign: 'center',
    display: 'inline-block',
    padding: unit,
  },
}))(Button);

Requirements

  • React 15/16+
  • IE 10+
  • WeakMap

Installation

Aesthetic requires React as a peer dependency.

npm install aesthetic react --save
// Or
yarn add aesthetic react

Documentation

https://milesj.gitbooks.io/aesthetic