Installation
npm install --save @types/postcss-rtl
Summary
This package contains type definitions for postcss-rtl (https://github.com/vkalinichev/postcss-rtl).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/postcss-rtl.
index.d.ts
import { PluginCreator } from "postcss";
declare namespace postcssRtl {
interface Options {
/**
* Custom function to add prefixes to selectors
* @example
* function addPrefixToSelector(selector, prefix) {
* // Make selectors like [dir=rtl] > .selector
* return `${prefix} > ${selector}`;
* }
*/
addPrefixToSelector?: ((selector: string, prefix: string) => string) | undefined;
/** Generate for only the specified direction */
onlyDirection?: "ltr" | "rtl" | undefined;
/**
* Whether to add attributes or classes.
*
* Attributes: `.foo` -> `[dir=rtl] .foo`\
* Classes: `.foo` -> `.dir-rtl .foo`
* @default 'attribute'
*/
prefixType?: "attribute" | "class" | undefined;
/**
* The prefix to use for added attributes/class selectors
* @default 'dir'
*/
prefix?: string | undefined;
/**
* Remove `rtl:*` comments after processing them
* @default true
*/
removeComments?: boolean | undefined;
/**
* Assume all styles are written in _RTL_, and generate _LTR_ styles
* @default false
*/
fromRTL?: boolean | undefined;
/** An array of CSS properties to ignore */
blacklist?: readonly string[] | undefined;
/** An array of CSS properties to include (only these will be processed) */
whitelist?: readonly string[] | undefined;
/**
* Aliases, passed to rtlcss
* @see {@link https://rtlcss.com/learn/usage-guide/aliases/}
*/
aliases?: Record<string, string> | undefined;
}
}
declare const postcssRtl: PluginCreator<postcssRtl.Options>;
export = postcssRtl;
Additional Details
- Last updated: Mon, 26 Feb 2024 18:07:24 GMT
- Dependencies: postcss
Credits
These definitions were written by Adam Thompson-Sharpe.