tpa-style-webpack-plugin
Version:
A Webpack plugin that handles wix tpa styles, it separates static css file that injects dynamic style at runtime.
37 lines (36 loc) • 1.88 kB
TypeScript
import { ITPAParams } from './generateTPAParams';
export declare const cssFunctions: {
join: (color1: any, strength1: any, color2: any, strength2: any) => string;
color: (colorValue: any, tpaParams: ITPAParams) => any;
font: (font: any, tpaParams: ITPAParams) => string;
opacity: (color: any, opacity: number) => string;
withoutOpacity: (color: any) => string;
string: (value: string) => string;
darken: (colorVal: any, darkenValue: number) => string;
lighten: (colorVal: any, lightenVal: number) => string;
whiten: (colorVal: any, whitenVal: number) => string;
number: (value: number | string) => number;
underline: (font: any) => string;
unit: (value: number | string, unit: string) => string;
fallback: (...args: any[]) => any;
direction: (value: string, tpaParams: ITPAParams) => string;
zeroAsTrue: (zero: any) => any;
calculate: (operator: any, ...args: any[]) => any;
readableFallback: (baseColor: string, suggestedColor: string, fallbackColor: string) => string;
/**
* Given foreground and background colors, checks to see if the colors are readable together.
* If not, it returns the first to be readable among:
* background color lightened/darkened by 1%
* background color lightened/darkened by 5%
* background color lightened/darkened by 10%
* background color lightened/darkened by 20%
* background color lightened/darkened by 30%
* background color lightened/darkened by 40%
* background color lightened/darkened by 50%
* background color lightened/darkened by 60%
* the method (lighten or darken) is determined by the ratio between the two given colors
* @param foreground - the foreground (text) color
* @param background - a background color
*/
smartBGContrast: (foreground: string, background: string) => string;
};