Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

rics

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rics

Lightweight SCSS-like CSS preprocessor for browser/real-time use

latest
Source
npmnpm
Version
0.3.20
Version published
Maintainers
1
Created
Source

rics

npm version minzipped size downloads

Core compiler for the rics CSS preprocessor. A fast, lightweight SCSS-like preprocessor that runs anywhere JavaScript runs.

Installation

npm install rics

Usage

import { compile } from "rics";

const css = compile(`
$primary: #f43f5e;

.button {
  background: $primary;

  &:hover {
    background: darken($primary, 10%);
  }
}
`);

API

compile(input, config?)

Compiles rics/SCSS input to CSS.

const css = compile(input);

compileWithDetails(input, config?)

Returns full compilation result including errors, warnings, and stats.

const result = compileWithDetails(input);

console.log(result.css);
console.log(result.errors); // CompileError[]
console.log(result.warnings); // CompileWarning[]
console.log(result.stats); // { duration, rules, iterations, inputSize, outputSize }

compileAsync(input, config?)

Non-blocking compilation for large inputs.

const result = await compileAsync(largeStylesheet);

Configuration

compile(input, {
  timeout: 5000, // Max compilation time (ms)
  maxIterations: 10000, // Max loop iterations
  maxNestingDepth: 64, // Max selector nesting
  minify: false, // Minify output
  strictMode: false, // Throw on first error
});

Features

  • Variables and math operations
  • Nesting with & parent selector
  • Mixins with parameters, default values, and named arguments
  • Custom functions with @function and @return
  • Control flow: @if, @else, @for, @each, @while
  • Color functions: darken, lighten, mix, saturate, and more
  • String interpolation with #{}
  • Native CSS pass-through for modern features

Benchmarks

Auto-generated. Run pnpm bench in the benchmarks folder to regenerate.

Performance (ops/sec, higher is better)

Preprocessorops/secComparison
rics897fastest
stylus3342.7x slower
sass2793.2x slower
less2214.1x slower

Package Size (minzipped, smaller is better)

PackageSizeDependenciesComparison
rics12.7 KB0smallest
less49.0 KB04x larger
stylus82.8 KB57x larger
sass686.0 KB154x larger

License

MIT

Built by Better Lyrics

Keywords

scss

FAQs

Package last updated on 28 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts