πOverview
Overview of cxcss and its Purpose
CxCss is a powerful CSS library that aims to provide all the capabilities and flexibility of native CSS directly from classnames. It simplifies the process of applying styles to HTML elements by allowing you to leverage classnames to achieve a wide range of styling options.
With cxcss, you can easily create and manage complex styles without writing extensive CSS code. It enables you to define classnames that encapsulate specific styling rules, making your styles modular, reusable, and easy to maintain.
Installation Instructions
To start using cxcss in your project, follow these simple installation steps:
Install cxcss from npm as a dev dependency by running the following command:
npm install --save-dev cxcssOnce cxcss is installed, you can run the watch compiler by executing the following command:
npx cxcssThis command sets up the watch compiler, which automatically detects changes in your CSS files and recompiles them as needed. Alternatively, you can use the
--buildflag for a production build:npx cxcss --buildOptionally, you can include the
cxcsscommand in your start scripts in thepackage.jsonfile. For example, in Next.js, you can modify the"dev"script as follows:{ "scripts": { "dev": "cxcss & next dev" } }This configuration allows you to run both the cxcss compiler and the Next.js development server simultaneously.
By default, running the compiler in watch or build mode generates an
index.cssfile in the root of your project. However, if you prefer the output file to be located in a different directory or customize other aspects of cxcss, you can achieve various configurations using thecx.config.jsonfile.
Here are a couple of example overviews from products with really great docs:
cx.config.json
The cx.config.json file allows you to customize and configure cxcss according to your project requirements. Here are the configurations you can achieve with the cx.config.json file:
Output Directory: Specify the output directory for the compiled CSS file. By default, the output file is generated in the root of your project.
Example
cx.config.jsonfile:{ "output": "path/to/output/directory/" }Watch Directory: Define the directory that cxcss should watch for changes during the watch mode. This optimization enhances the watch process performance by focusing on specific directories rather than the entire project.
Example
cx.config.jsonfile:{ "watchDirectory": "src/styles/" }In the above configuration, cxcss will only watch the
"src/styles"directory for changes.
By utilizing the cx.config.json file, you can tailor cxcss to your specific project needs and achieve desired configurations for output, watching directories, and preprocessor integration.
Quick links
π‘What we doβ¨Our FeaturesGet Started
We've put together some helpful guides for you to get setup with our product quickly and easily.
π οΈGetting set upπSetting permissionsπ§Inviting MembersLast updated