0.11.1 • Published 3 years ago

@aesthetic/core v0.11.1

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

Aesthetic - Core API

Build Status npm version npm deps

Unifies a design system and a CSS-in-JS engine into a powerful framework agnostic API.

import { Aesthetic } from '@aesthetic/core';
import dayTheme from './design/system/dayTheme';
import nightTheme from './design/system/nightTheme';

const aesthetic = new Aesthetic({
	defaultUnit: 'px',
	deterministicClasses: false,
});

// Register a theme (provided by the design system)
aesthetic.registerDefaultTheme('day', dayTheme);

// Register a theme that has global styles
aesthetic.registerTheme('night', nightTheme, (css) => ({
	'@root': css.mixin('root', {
		backgroundColor: css.var('palette-neutral-bg-base'),
		height: '100%',
	}),
}));

// Create a component style sheet
const styleSheet = aesthetic.createStyleSheet((css) => ({
	button: {
		textAlign: 'center',
		display: 'inline-block',
		padding: css.var('spacing-df'),
	},
}));

// Render the style sheet into the document
const classNames = aesthetic.renderStyleSheet(styleSheet);

Though the core API is framework agnostic and can be used stand-alone, it's encouraged to use a framework integration package for better ergonomics.

Features

Supports all features provided by unified packages, while also providing...

  • Register, manage, and activate themes, powered by the design system.
  • Automatically activates a theme based on a users preferences (color scheme, contrast, etc).
  • Scopes active theme styles and CSS variables to the body to avoid global scope pollution.
  • Factories and renders component and theme style sheets.
  • Supports color scheme, contrast, and theme variants for style sheets.
  • Renders font faces, keyframes, and CSS imports.
  • Handles server-side rendering and client-side hydration.
  • Integrates with the React framework.

Requirements

  • IE 11+

Installation

yarn add @aesthetic/core

Documentation

https://aestheticsuite.dev

0.11.1

3 years ago

0.11.0

3 years ago

0.10.8

3 years ago

0.10.7

3 years ago

0.10.6

3 years ago

0.10.5

3 years ago

0.10.2

3 years ago

0.10.3

3 years ago

0.10.4

3 years ago

0.10.1

3 years ago

0.10.0

3 years ago

0.9.6

3 years ago

0.9.5

3 years ago

0.9.4

3 years ago

0.9.3

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.8

3 years ago

0.7.6

3 years ago

0.7.7

3 years ago

0.7.5

3 years ago

0.7.4

3 years ago

0.7.3

3 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.3

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.8

4 years ago

0.4.7

4 years ago

0.4.6

4 years ago

0.4.5

4 years ago

0.4.4

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.0

4 years ago

0.0.3

4 years ago

0.1.1

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago