Develop ultra fast with Prismane 🎉

CSS Variables

Prismane provides a set of global CSS variables that facilitate seamless theme integration into your applications. With Prismane's global CSS variables, you can achieve consistent theming across your entire application, making it effortless to create a cohesive and personalized user experience.

How Are The CSS Variables Generated

When you provide a theme to <PrismaneProvider/>, it will automatically transpile the passed object and generate a set of CSS variables, which would then be applied to the root element.

Important

If no theme object is passed, the base theme will be used!

For example:

const theme = {
  colors: {
    primary: {
      50: "#fafafa",
      100: "#f7f7f7",
    },
  },
};

Will be transpiled into this:

:root {
  ...other theme CSS variables
  --prismane-colors-primary-50: "#fafafa";
  --prismane-colors-primary-100: "#f7f7f7";
}

Using CSS Variables

Prismane's CSS variables can be used in CSS stylesheet files, as well as in components.

Inside CSS Stylesheet

// index.css

.some-component-class {
  background-color: var(--prismane-colors-primary-500);
}

.some-other-component-class {
  font-size: calc(var(--prismane-spacing) * 4);
}

Inside Components

import { Box } from "@prismane/core";

const Page = () => {
  return (
    <Box
      style={{
        backgroundColor: "var(--primane-colors-primary-500)",
      }}
    >
      Hello, world
    </Box>
  );
};

export default Page;

All CSS Variables

This is a list of all CSS variables that Prismane adds to your app:

CSS Variable NameTheme Token
--prismane-colors-primary-50theme.colors.primary[50]
--prismane-colors-primary-100theme.colors.primary[100]
--prismane-colors-primary-200theme.colors.primary[200]
--prismane-colors-primary-300theme.colors.primary[300]
--prismane-colors-primary-400theme.colors.primary[400]
--prismane-colors-primary-500theme.colors.primary[500]
--prismane-colors-primary-600theme.colors.primary[600]
--prismane-colors-primary-700theme.colors.primary[700]
--prismane-colors-primary-800theme.colors.primary[800]
--prismane-colors-primary-900theme.colors.primary[900]
--prismane-colors-base-50theme.colors.base[50]
--prismane-colors-base-100theme.colors.base[100]
--prismane-colors-base-200theme.colors.base[200]
--prismane-colors-base-300theme.colors.base[300]
--prismane-colors-base-400theme.colors.base[400]
--prismane-colors-base-500theme.colors.base[500]
--prismane-colors-base-600theme.colors.base[600]
--prismane-colors-base-700theme.colors.base[700]
--prismane-colors-base-800theme.colors.base[800]
--prismane-colors-base-900theme.colors.base[900]
--prismane-spacingtheme.spacing