@fluxwp/tokens
v0.4.1
Published
Design tokens of FluxWP: colours (light/dark), brand, spacing, radius and type as TS values, CSS variables and React Native themes.
Maintainers
Readme
@fluxwp/tokens
Design tokens of FluxWP: colour palette (light and dark), brand colours, spacing, radius and type, as TypeScript values, CSS variables and React Native themes. Zero dependencies.
Install
npm i @fluxwp/tokensUsage
import { toCssVars, themeColors, space, radius } from '@fluxwp/tokens';
const brand = { primary: '#2f3437', primaryContrast: '#ffffff', accent: '#c8a96a' };
// CSS variables: --flux-primary, --flux-bg, --flux-space-4 …
Object.assign(document.documentElement.style, toCssVars('dark', brand));
const c = themeColors('light', brand); // typed colour map
const gap = space[4]; // 16nativeTheme(mode, brand) returns the same values as one object (colors, space, radius, font) for
React Native.
The FluxWP packages
| Package | What it is |
|---|---|
| @fluxwp/plugin-kit | Build wp-admin React screens for your own WordPress plugin (Vite preset + flx-kit codegen) |
| @fluxwp/graphql | Typed GraphQL client and React hooks for Flux GraphQL (WPGraphQL) |
| @fluxwp/host | Host context of a screen: site client, user, locale |
| @fluxwp/ui | React UI kit of FluxWP screens: Check, DatePicker, Modal, Icon … |
| @fluxwp/core | WordPress REST client, sign-in (OAuth PKCE, app passwords), accounts, i18n |
| @fluxwp/tokens | Design tokens: colours, spacing, radius, type, light / dark |
FluxWP is an open-source, all-in-one WordPress suite (donations, forms, e-commerce, CRM, e-mail, AI, SEO) with a desktop and mobile app. Source: github.com/FluxWP/FluxWP. Questions and ideas: [email protected].
License
GPL-2.0-or-later
