Rasengan Logo
Rasengan Logo
  • Docs
  • Blog
  • Showcase
Using stable versionv1.2.1
Documentation
Packages
Templates
Rasengan UI Kit
Using stable versionv1.2.1
Documentation
Packages
Templates
Rasengan UI Kit

CORE CONCEPTS

CSS Preprocessors

Rasengan.js supports popular CSS preprocessors like Sass, Less, and Stylus. These tools make writing CSS easier by adding features like variables, nested rules, and functions.

Using a Preprocessor

To use a preprocessor, install the required package and create a stylesheet with the correct file extension. Then, import the file into your components.

Sass (.scss / .sass)

Sass adds features like variables and nesting to CSS. Rasengan.js supports it once you install the sass package.

1. Install Sass

Terminal
npm install --save-dev sass

2. Create a Sass File

MyComponent.scss
$primary-color: #333; .my-component { color: $primary-color; }

3. Import It in a Component

MyComponent.jsx
import "./MyComponent.scss"; export default function MyComponent() { return <div className="my-component">Hello, world!</div>; }

Using Sass with CSS Modules

CSS Modules prevent class name conflicts by scoping styles locally. Use the .module.scss extension:

MyComponent.module.scss
$primary-color: #333; .component { color: $primary-color; }
MyComponent.jsx
import styles from "./MyComponent.module.scss"; export default function MyComponent() { return <div className={styles.component}>Hello, world!</div>; }

Less (.less)

Less is another CSS preprocessor similar to Sass but uses @ for variables.

1. Install Less

Terminal
npm install --save-dev less

2. Create a Less File

MyComponent.less
@primary-color: #333; .my-component { color: @primary-color; }

3. Import It in a Component

MyComponent.jsx
import "./MyComponent.less"; export default function MyComponent() { return <div className="my-component">Hello, world!</div>; }

Stylus (.styl / .stylus)

Stylus is a flexible preprocessor that allows cleaner, indentation-based syntax.

1. Install Stylus

Terminal
npm install --save-dev stylus

2. Create a Stylus File

MyComponent.styl
primary-color = #333 .my-component color primary-color

3. Import It in a Component

MyComponent.jsx
import "./MyComponent.styl"; export default function MyComponent() { return <div className="my-component">Hello, world!</div>; }
Tailwind CSS
Optimizing Images

On This Page

  • Using a Preprocessor
  • Sass (.scss / .sass)
    • 1. Install Sass
    • 2. Create a Sass File
    • 3. Import It in a Component
    • Using Sass with CSS Modules
  • Less (.less)
    • 1. Install Less
    • 2. Create a Less File
    • 3. Import It in a Component
  • Stylus (.styl / .stylus)
    • 1. Install Stylus
    • 2. Create a Stylus File
    • 3. Import It in a Component

Discover Plus Ultra ✨

A stunning and well crafted Portfolio website to showcase your work in a nice way.

Rasengan Logo
Rasengan Logo

Resources

  • Docs
  • Packages
  • Blog
  • Showcase
  • Support us

Products

  • Rasengan UI
  • Rasengan Hub
  • Chidori
  • Nindo
  • Chunin

Community

  • Github
  • X (Twitter)

Subscribe to the Newsletter

Stay informed to the news about rasengan.js including new releases, events, etc...

© 2024-2026 Rasengan Labs, All rights reserved.