Installation
Install Squeeze's React components and custom Tailwind CSS utility classes.
Setup GitHub Packages authentication
Create an .npmrc at the root of your project and add the @curology scoped registry:
@curology:registry=https://npm.pkg.github.com
Create or modify the .npmrc in your home directory (~/.npmrc) to include a GitHub Personal Access Token.
//npm.pkg.github.com/:_authToken=${TOKEN}
Install the necessary packages
npm i @curology/ui-components-web @curology/ui-styles-web @curology/ui-tokens
Configure your build
Squeeze's components are styled using Tailwind CSS's utility classes, so those classes need to be included during the build of your application. It's best to build your app using Tailwind as well so you can leverage Squeeze's robust design tokens, but we also support simply including the built component CSS.
- Apps using Tailwind
- Apps without Tailwind
First, setup your Tailwind config to extend @curology/ui-styles-web. This will consume the design tokens and customize all of Tailwind's classes to match Squeeze. You will need to include the built JS files from the ui-components-web directory so that Tailwind can scan for which classes are used to add them to the final CSS output.
const config = require('@curology/ui-styles-web/tailwind.config.cjs');
/** @type {import('tailwindcss').Config} */
module.exports = {
...config,
content: ['./node_modules/@curology/ui-components-web/dist/react/**/*.js'],
};
Next, import the CSS variables generated by @curology/ui-tokens. These variables are used by the Tailwind config to allow the same styles to be used by our different brands.
@import '@curology/ui-tokens/curology';
/* or */
@import '@curology/ui-tokens/agency';
Finally, include the Tailwind base and utility classes, as well as the appropriate fonts for Squeeze.
@import '@curology/ui-styles-web';
If you aren't using Tailwind, you can import the built component CSS directly. You can technically do this even if you are using Tailwind in your project, but your final bundle sizes will be bigger.
import '@curology/ui-tokens/curology';
import '@curology/ui-components-web/react/index.css';