Skip to main content

API Reference


wind.add()

Adds classes to a Wind instance.

  • Type

    interface Wind {
    mount(str: string | Wind): Wind;
    }
  • Details

    It takes string of classes or a Wind instance and adds it to the instance's classes.

  • Example

    import wind from 'afterwind';

    const style = wind('bg-red text-sm');
    wind.add('font-bold');

wind.remove()

Removes the list of classes passed to it.

  • Type

    interface Wind {
    remove(str: string | Wind): Wind;
    }
  • Details

    It takes a string of classes or a Wind object and removes the classes from the instance.

  • Example

    Remove all text classes

    const style = wind('bg-red text-sm md:text-lg');
    style.remove('text');

    Remove all classes with md: modifier

    const style = wind('bg-red text-sm md:text-lg hover:md:mb-3');
    style.remove('md:');

wind.toString()

Convert instance to a string of classes.

  • Type

    interface Wind {
    toString(): void;
    }
  • Details

    This method takes no argument. It simply returns the instance as a string of classes.

  • Example

    Getting the string representation of an instance

    wind.toString();