How to use the free-style.IS_UNIQUE function in free-style

To help you get started, we’ve selected a few free-style examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github typestyle / typestyle / src / internal / formatting.ts View on Github external
export function ensureStringObj(object: types.NestedCSSProperties): { result: any, debugName: string } {
  /** The final result we will return */
  const result: types.CSSProperties & Dictionary = {};
  let debugName = '';

  for (const key in object) {

    /** Grab the value upfront */
    const val: any = (object as any)[key];

    /** TypeStyle configuration options */
    if (key === '$unique') {
      result[FreeStyle.IS_UNIQUE] = val;
    }
    else if (key === '$nest') {
      const nested = val!;
      for (let selector in nested) {
        const subproperties = nested[selector]!;
        result[selector] = ensureStringObj(subproperties).result;
      }
    }
    else if (key === '$debugName') {
      debugName = val;
    }
    else {
      result[key] = val
    }
  }

free-style

Make CSS easier and more maintainable by using JavaScript

MIT
Latest version published 6 months ago

Package Health Score

64 / 100
Full package analysis