unocss-preset-ctx
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

unocss-preset-ctx

Introduction

unocss-preset-ctx is an extension library based on UnoCSS that provides additional preset rules. Make it easier to modify element styles in the context of CSS.

For example:

<div class="ctxs-p_px-1 ctx-c-text_[#3451b2] ctx-c-bg_gray dark:ctx-r-y">
  <span class="ctxs-p c-ctx-c-text-700 bg-ctx-c-bg-300">Hello</span>
  <span class="ctxs-p c-ctx-c-text-300 bg-ctx-c-bg-700">World</span>
</div>

Usage

Before using, please follow the official UnoCss documentation to add the required UnoCss dependencies and configurations to your project. Then proceed with the following steps.

npm

npm i -D unocss-preset-ctx

pnpm

pnpm i -D unocss-preset-ctx

yarn

yarn add -D unocss-preset-ctx

Similar to other UnoCss preset libraries, you need to add this preset library in the UnoCss configuration file before using.

import { defineConfig, presetUno } from 'unocss';
import { presetCtx } from 'unocss-preset-ctx';

export default defineConfig({ presets: [presetUno(), presetCtx()] });

Documentation

Read the documentation for more details.

Credits

License

MIT

Package Sidebar

Install

npm i unocss-preset-ctx

Weekly Downloads

1

Version

1.2.1

License

MIT

Unpacked Size

15.9 kB

Total Files

17

Last publish

Collaborators

  • nixwai