Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@master/css

Package Overview
Dependencies
Maintainers
0
Versions
430
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@master/css - npm Package Compare versions

Comparing version 2.0.0-rc.47 to 2.0.0-rc.48

dist/config/rules.cjs

2

dist/config/functions.d.ts

@@ -1,3 +0,3 @@

import type { FunctionDefinitions } from './';
import { FunctionDefinitions } from '../types/config';
declare const functions: FunctionDefinitions;
export default functions;

@@ -6,52 +6,7 @@ import at from './at';

import variables from './variables';
import syntaxes from './syntaxes';
import rules from './rules';
import modes from './modes';
import functions from './functions';
import type { PropertiesHyphen } from 'csstype';
import type { Rule, SyntaxDefinition, ValueComponent } from '../rule';
import { Config } from '../types/config';
declare const config: Config;
export { config, at, selectors, utilities, syntaxes, functions, animations, variables, modes };
export type VariableValue = number | string | false | (number | string)[];
export type VariableDefinition = {
[key in '' | `@${string}` | string]?: VariableValue | VariableDefinition;
} | VariableValue;
export type CSSKeyframes = Record<'from' | 'to' | string, PropertiesHyphen>;
export type AnimationDefinitions = Record<string, CSSKeyframes>;
export type SelectorDefinitions = Record<string, string | string[]>;
export interface AtDefinitions {
[key: string]: number | string | AtDefinitions;
}
export interface StyleDefinitions {
[key: string]: string | StyleDefinitions;
}
export type SyntaxDefinitions = Partial<Record<keyof typeof syntaxes | string, SyntaxDefinition>>;
export type VariableDefinitions = {
[key in keyof typeof syntaxes]?: VariableDefinition;
} & Record<string, VariableDefinition>;
export type UtilityDefinitions = {
[key in keyof typeof utilities]?: PropertiesHyphen;
} & Record<string, PropertiesHyphen>;
export type ModeDefinitions = Record<string, 'class' | 'media' | 'host' | false>;
export interface FunctionDefinition {
unit?: string;
transform?(this: Rule, value: string, bypassVariableNames: string[]): string | ValueComponent[];
}
export type FunctionDefinitions = Record<string, FunctionDefinition>;
export interface Config {
extends?: (Config | any)[];
styles?: StyleDefinitions;
at?: AtDefinitions;
selectors?: SelectorDefinitions;
utilities?: UtilityDefinitions;
variables?: VariableDefinitions;
syntaxes?: SyntaxDefinitions;
rootSize?: number;
baseUnit?: number;
defaultMode?: 'light' | 'dark' | string | false;
scope?: string;
important?: boolean;
override?: boolean;
functions?: FunctionDefinitions;
animations?: AnimationDefinitions;
modes?: ModeDefinitions;
}
export { config, at, selectors, utilities, rules, functions, animations, variables, modes };

@@ -1,3 +0,3 @@

import type { ModeDefinitions } from './';
import { ModeDefinitions } from '../types/config';
declare const modes: ModeDefinitions;
export default modes;

@@ -1,34 +0,24 @@

import { Rule, type NativeRule, type RegisteredRule } from './rule';
import type { Config, AnimationDefinitions } from './config';
import { SyntaxRule } from './syntax-rule';
import './types/global';
interface VariableCommon {
usage?: number;
group?: string;
name: string;
key: string;
modes?: Record<string, TypeVariable>;
}
export interface StringVariable {
type: 'string';
value: string;
}
export interface NumberVariable {
type: 'number';
value: number;
}
export interface ColorVariable {
type: 'color';
value: string;
space: 'rgb' | 'hsl';
}
export type TypeVariable = StringVariable | NumberVariable | ColorVariable;
export type Variable = TypeVariable & VariableCommon;
import SyntaxLayer from './syntax-layer';
import { Rule } from './rule';
import Layer from './layer';
import NonLayer from './non-layer';
import { DefinedRule, Variable } from './types/syntax';
import { AnimationDefinitions, Config } from './types/config';
export default class MasterCSS {
customConfig?: Config | undefined;
static config: Config;
readonly syntaxes: Rule[];
readonly ruleBy: Record<string, Rule>;
readonly definedRules: DefinedRule[];
readonly config: Config;
readonly classesUsage: Record<string, number>;
readonly config: Config;
readonly Rules: RegisteredRule[];
readonly layerStatementRule: Rule;
readonly rules: (Layer | Rule)[];
readonly animationsNonLayer: NonLayer;
readonly baseLayer: SyntaxLayer;
readonly themeLayer: Layer;
readonly presetLayer: SyntaxLayer;
readonly stylesLayer: SyntaxLayer;
readonly generalLayer: SyntaxLayer;
get text(): string;
constructor(customConfig?: Config | undefined);

@@ -41,16 +31,21 @@ resolve(): void;

*/
match(className: string): RegisteredRule | undefined;
match(className: string): DefinedRule | undefined;
/**
* Generate syntaxes from class name
* Generate syntax rules from class name
* @param className
* @returns Rule[]
* @returns SyntaxRule[]
*/
generate(className: string): Rule[];
generate(className: string, mode?: string): SyntaxRule[];
/**
* Create rule from given syntax
* @param syntax
* @returns Rule
* Create syntax rule from given class name
* @param className
* @returns SyntaxRule
*/
create(syntax: string): Rule | undefined;
create(className: string, fixedClass?: string, mode?: string): SyntaxRule | undefined;
/**
* Create syntax rule from given selector text
* @param selectorText
*/
createFromSelectorText(selectorText: string): SyntaxRule[];
/**
* 根據蒐集到的所有 DOM class 重新 create

@@ -62,39 +57,13 @@ */

add(...classNames: string[]): this;
delete(...classNames: string[]): void;
/**
* 加工插入規則
* 1. where
* 2. normal
* 3. where selectors
* 4. normal selectors
* 5. media where
* 6. media normal
* 7. media where selectors
* 8. media selectors
* 9. media width where
* 10. media width
* 11. media width where selectors
* 12. media width selectors
*/
insert(rule: Rule): number | undefined;
get text(): string;
handleRuleWithAnimationNames(rule: Rule, initializing?: boolean): void;
handleRuleWithVariableNames(rule: Rule, initializing?: boolean): void;
pushVariableNativeRule(mode: string, variableCSSRule: CSSStyleRule): NativeRule;
remove(...classNames: string[]): void;
getModeSelector(modeName: string): string | undefined;
}
export declare const masterCSSs: MasterCSS[];
export default interface MasterCSS {
style: HTMLStyleElement;
styles: Record<string, string[]>;
stylesBy: Record<string, string[]>;
style: HTMLStyleElement | null;
components: Record<string, string[]>;
selectors: Record<string, [RegExp, string[]][]>;
variables: Record<string, Variable>;
at: Record<string, string | number>;
variablesNativeRules: Record<string, NativeRule>;
hasKeyframesRule: boolean;
animations: Record<string, AnimationDefinitions & {
usage?: number;
native?: NativeRule;
}>;
animations: Record<string, AnimationDefinitions>;
}
export {};
export * from './config';
export * from './rule';
export * from './common';
export * from './core';
export { Rule } from './rule';
export * from './syntax-rule';
export * from './rule';
export { default as Layer } from './layer';
export { default as SyntaxLayer } from './syntax-layer';
export { default as NonLayer } from './non-layer';
export { default as SyntaxRuleType } from './syntax-rule-type';
export { default as MasterCSS, default } from './core';
export * from './types/config';
export * from './types/syntax';
export { default as extendConfig } from './utils/extend-config';

@@ -14,5 +19,4 @@ export { default as reorderForReadableClasses } from './utils/reorder-for-readable-classes';

export { default as areRuleStatesEqual } from './utils/are-rule-states-equal';
export { default as areRulesDuplicated } from './utils/are-syntaxes-duplicated';
export { default as areRulesDuplicated } from './utils/are-rules-duplicated';
export { default as generateCSS } from './utils/generate-css';
export { default as isCoreRule } from './utils/is-core-rule';
export type { NativeRule, MediaFeatureComponent, MediaQuery } from './rule';

@@ -1,28 +0,14 @@

declare const enum Layer {
/**
* utility classes
* @example block, inline
*/
Utility = -4,
/**
* native shorthand
* @example border, padding, margin
*/
NativeShorthand = -3,
/**
* shorthand
* @example px, py, mx, my
*/
Shorthand = -2,
/**
* native properties
* @example color, background-color, font-size
*/
Native = -1,
/**
* normal
* @example grid-cols
*/
Normal = 0
import { Rule } from './rule';
import MasterCSS from './core';
export default class Layer {
name: string;
css: MasterCSS;
readonly rules: Rule[];
readonly usages: Record<string, number>;
native: CSSLayerBlockRule | null;
constructor(name: string, css: MasterCSS);
insert(rule: Rule, index?: number): number | undefined;
delete(key: string): Rule | undefined;
reset(): void;
get text(): string;
}
export default Layer;

@@ -1,152 +0,11 @@

import MasterCSS, { type Variable } from './core';
import Layer from './layer';
import { type PropertiesHyphen } from 'csstype';
export declare class Rule {
readonly className: string;
readonly RegisteredRule: RegisteredRule;
css: MasterCSS;
readonly at: Record<string, AtComponent[]>;
readonly priority: number;
readonly natives: NativeRule[];
readonly order: number;
readonly layer: Layer;
readonly declarations?: PropertiesHyphen;
animationNames?: string[];
variableNames?: string[];
constructor(className: string, RegisteredRule: RegisteredRule, css: MasterCSS);
resolveAtComponent(atComponent: AtComponent): string;
resolveValue: (valueComponents: ValueComponent[], unit: string, bypassVariableNames: string[], bypassParsing: boolean) => string;
readonly name: string;
nodes: RuleNode[];
constructor(name: string, nodes?: RuleNode[]);
get key(): string;
get text(): string;
parseValues: (currentValueComponents: ValueComponent[], i: number, value: string, unit: string, endSymbol: string, parentFunctionName?: string, bypassParsing?: boolean, bypassVariableNames?: string[]) => number;
parseValue(token: string | number, unit?: any): {
value: string;
type: 'string';
} | {
value: number;
unit: string;
type: 'number';
};
}
export type AtComponent = AtArbitraryComponent | AtFeatureComponent | AtOperatorComponent;
export interface AtArbitraryComponent {
type: 'arbitrary';
token?: string;
value: string;
}
export interface AtFeatureComponent {
type: 'feature';
token?: string;
name: string;
valueType: 'number' | 'string';
value: string | number;
unit?: string;
}
export interface AtOperatorComponent {
type: 'operator';
token: '&';
value: 'and';
}
export type ValueComponent = StringValueComponent | NumericValueComponent | FunctionValueComponent | VariableValueComponent | SeparatorValueComponent;
export interface StringValueComponent {
text?: string;
token: string;
type: 'string';
value: string;
}
export interface NumericValueComponent {
text?: string;
token: string;
type: 'number';
value: number;
unit?: string;
}
export interface FunctionValueComponent {
text?: string;
token: string;
type: 'function';
name: string;
symbol: string;
children: ValueComponent[];
bypassTransform?: boolean;
}
export interface VariableValueComponent {
text?: string;
token: string;
type: 'variable';
name: string;
alpha?: string;
fallback?: string;
variable?: Variable;
}
export interface SeparatorValueComponent {
text?: string;
token: string;
type: 'separator';
value: string;
}
export interface Rule extends RegisteredRule {
token: string;
vendorPrefixSelectors: Record<string, string[]>;
vendorSuffixSelectors: Record<string, string[]>;
important: boolean;
direction: string;
mode: string;
unitToken: string;
keyToken: string;
valueToken: string;
stateToken: string;
atToken: string;
hasWhere: boolean;
valueComponents: ValueComponent[];
}
export interface RegisteredRule {
id: string;
key?: string;
keys: string[];
matchers: {
key?: RegExp;
variable?: RegExp;
value?: RegExp;
arbitrary?: RegExp;
};
variables: Record<string, Variable>;
order: number;
definition: SyntaxDefinition;
}
export interface SyntaxDefinition {
layer?: Layer;
matcher?: RegExp;
sign?: string;
key?: string;
subkey?: string;
ambiguousKeys?: string[];
ambiguousValues?: (RegExp | string)[];
variables?: string[];
separators?: string[];
unit?: any;
declarations?: PropertiesHyphen;
includeAnimations?: boolean;
analyze?: (this: Rule, className: string) => [valueToken: string, prefixToken?: string];
transformValue?(this: Rule, value: string): string;
transformValueComponents?(this: Rule, valueComponents: ValueComponent[]): ValueComponent[];
declare?(this: Rule, value: string, valueComponents: ValueComponent[]): PropertiesHyphen;
delete?(this: Rule, className: string): void;
create?(this: Rule, className: string): void;
insert?(this: Rule): void;
}
export interface NativeRule {
export interface RuleNode {
text: string;
cssRule?: CSSRule;
native?: CSSRule;
}
export interface MediaFeatureComponent {
type: string;
tokenType?: string;
operator?: string;
value: number;
unit: string;
}
export interface MediaQuery {
token: string;
features: Record<string, MediaFeatureComponent>;
type?: string;
}

@@ -1,2 +0,2 @@

import type { Rule } from '../rule';
export default function areRuleAtEqual(aRule: Rule, bRule: Rule): boolean;
import type { SyntaxRule } from '../syntax-rule';
export default function areRuleAtEqual(aSyntaxRule: SyntaxRule, bSyntaxRule: SyntaxRule): boolean;

@@ -1,2 +0,2 @@

import type { Rule } from '../rule';
export default function areRuleModesEqual(aRule: Rule, bRule: Rule): boolean;
import type { SyntaxRule } from '../syntax-rule';
export default function areRuleModesEqual(aSyntaxRule: SyntaxRule, bSyntaxRule: SyntaxRule): boolean;

@@ -1,2 +0,2 @@

import type { Rule } from '../rule';
export default function areRuleSelectorsEqual(aRule: Rule, bRule: Rule): boolean;
import type { SyntaxRule } from '../syntax-rule';
export default function areRuleSelectorsEqual(aSyntaxRule: SyntaxRule, bSyntaxRule: SyntaxRule): boolean;

@@ -1,2 +0,2 @@

import type { Rule } from '../rule';
export default function areRuleStatesEqual(aRule: Rule, bRule: Rule): boolean;
import type { SyntaxRule } from '../syntax-rule';
export default function areRuleStatesEqual(aSyntaxRule: SyntaxRule, bSyntaxRule: SyntaxRule): boolean;

@@ -1,3 +0,3 @@

import { SyntaxDefinition } from '../rule';
declare const autofillSolidStyle: SyntaxDefinition['transformValueComponents'];
import { SyntaxRuleDefinition } from '../types/config';
declare const autofillSolidStyle: SyntaxRuleDefinition['transformValueComponents'];
export default autofillSolidStyle;

@@ -1,2 +0,2 @@

import type { Config } from '../config';
import type { Config } from '../types/config';
export default function extendConfig(...configs: (Config | undefined)[]): Config;

@@ -1,1 +0,1 @@

{"name":"@master/css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","test":"vitest","type-check":"tsc --noEmit","lint":"eslint"},"license":"MIT","description":"The CSS language and framework for rapidly building modern and high-performance websites","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/core"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":false,"main":"./dist/index.cjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.mjs"}},"bin":"./dist/bin/index.mjs","files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/colors":"^2.1.0","@master/normal.css":"^3.1.0","@techor/extend":"^3.1.7","csstype":"^3.1.3"},"devDependencies":{"shared":"^2.0.0-rc.47"},"version":"2.0.0-rc.47"}
{"name":"@master/css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","test":"vitest","type-check":"tsc --noEmit","lint":"eslint"},"license":"MIT","description":"The CSS language and framework for rapidly building modern and high-performance websites","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/core"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":false,"main":"./dist/index.cjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.mjs"}},"bin":"./dist/bin/index.mjs","files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/colors":"^2.1.0","@master/normal.css":"^3.1.0","@techor/extend":"^3.1.7","csstype":"^3.1.3"},"devDependencies":{"shared":"^2.0.0-rc.48"},"version":"2.0.0-rc.48"}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc