@ringcentral/spring-theme
v1.9.1
Published
Theme system and design tokens for Spring UI, providing Tailwind CSS configurations and multi-theme support
Keywords
Readme
@ringcentral/spring-theme
Tailwind CSS plugin and theming system for Spring UI.
Note: If you already use @ringcentral/spring-ui, its theme APIs are re-exported from @ringcentral/spring-ui, so you don’t need to install this package separately.
Installation
Using yarn:
yarn add @ringcentral/spring-themeUsing npm:
npm i @ringcentral/spring-themeNote: For Tailwind/PostCSS setup instructions, see the @ringcentral/spring-ui README.
Tailwind Configuration
Add the Spring plugin to your tailwind.config.js:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./src/**/*.{js,ts,jsx,tsx}',
'node_modules/@ringcentral/spring-ui/**/*.js',
],
plugins: [
require('@ringcentral/spring-theme/tailwind')({
// override: false, // optional: disable overriding default Tailwind tokens
}),
],
};Usage
// If your app already installs @ringcentral/spring-ui (recommended)
import { ThemeProvider, suiLight } from '@ringcentral/spring-ui';
// Or, when using the package directly
import { ThemeProvider, suiLight } from '@ringcentral/spring-theme';
function App() {
return (
<ThemeProvider theme={suiLight}>{/* your app */}</ThemeProvider>
);
}License
MIT
