2.4.0 • Published 5 months ago

@moser-inc/unocss-preset-moser-labs v2.4.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
5 months ago

UnoCSS Preset Moser Labs

Shared UnoCSS preset for the Moser Labs suite of applications.

Install

# npm
npm i -D @moser-inc/unocss-preset-moser-labs

# yarn
yarn add -D @moser-inc/unocss-preset-moser-labs

# pnpm
pnpm i -D @moser-inc/unocss-preset-moser-labs

Initialize

// uno.config.ts

import { defineConfig } from 'unocss';
import { presetMoserLabs } from '@moser-inc/unocss-preset-moser-labs';

export default defineConfig({
  presets: [presetMoserLabs()], // No default
  presets: [presetMoserLabs({ defaultApp: 'wellness' })], // With default

  // Optionally include processing internal Prime components for utility
  // classes and icons
  content: {
    pipeline: {
      include: [
        /(.*\/)primereact(.*)\.(c|m)?(js)(x?)$/, // PrimeReact Components
        /\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/, // Default
      ],
    },
  },
});

Options

presetMoserLabs({
  /**
   * Set the default theme when the application name is not included in the class (e.g. `bg-primary-gradient`).
   */
  defaultApp?: MoserLabsAppThemeKey;
  /**
   * Extend `presetWind3` options.
   *
   * https://unocss.dev/presets/wind
   */
  extendWind3Options?: PresetWind3Options;
  /**
   * Extend `presetPrime` options.
   *
   * https://github.com/danielwaltz/unocss-preset-prime
   */
  extendPrimeOptions?: PresetPrimeOptions;
  /**
   * Extend `presetIcons` options.
   *
   * https://unocss.dev/presets/icons
   */
  extendIconsOptions?: PresetIconsOptions;
});

Semantic Colors

This preset exports helpful types and the generated theme colors directly for extending the theme to support application specific semantic colors.

:warning: For usage at runtime, use the dedicated export to prevent loading core UnoCSS logic: import { primeThemeColors } from '@moser-inc/unocss-preset-moser-labs/theme'.

// uno.config.ts

import { defineConfig } from 'unocss';
import { presetMoserLabs, primeThemeColors } from '@moser-inc/unocss-preset-moser-labs';

export default defineConfig({
  presets: [presetMoserLabs()],
  theme: {
    colors: {
      success: {
        dark: primeThemeColors.green[900],
        light: primeThemeColors.green[100],
      },
      warning: {
        dark: primeThemeColors.orange[900],
        light: primeThemeColors.orange[100],
      },
      error: {
        dark: primeThemeColors.red[900],
        light: primeThemeColors.red[100],
      },
    },
  },
  shortcuts: {
    'bg-success': 'bg-success-dark light:bg-success-light',
    'bg-warning': 'bg-warning-dark light:bg-warning-light',
    'bg-error': 'bg-error-dark light:bg-error-light',
  },
});
1.18.1

11 months ago

1.18.0

12 months ago

1.18.5

10 months ago

1.18.4

10 months ago

1.18.3

10 months ago

1.18.2

10 months ago

2.2.1

6 months ago

2.2.0

6 months ago

2.4.0

5 months ago

2.0.0

9 months ago

2.3.0

5 months ago

2.1.0

7 months ago

1.17.0

1 year ago

1.16.6

1 year ago

1.16.5

1 year ago

1.16.4

1 year ago

1.16.3

2 years ago

1.16.2

2 years ago

1.15.0

2 years ago

1.13.2

2 years ago

1.14.0

2 years ago

1.13.1

2 years ago

1.13.0

2 years ago

1.11.2

2 years ago

1.12.0

2 years ago

1.11.1

2 years ago

1.16.1

2 years ago

1.16.0

2 years ago

1.9.0

2 years ago

1.8.0

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.11.0

2 years ago

1.10.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago