Core

The core variables, functions and mixins for Vrembem components.

npm version

npm install @vrembem/core

Sass

To make use of global Vrembem functions, mixins and variables, it is recommended to import the core index file:

@import "@vrembem/core";

You could also import these files individually, but the order of imports matters and some rely on others being imported before.

@import "@vrembem/core/src/css/palette";
@import "@vrembem/core/src/css/functions";
@import "@vrembem/core/src/css/variables";
@import "@vrembem/core/src/css/mixins";

JavaScript

To make use of the core JavaScript modules, import the specific named export you need:

// Import specific named exports
import { addClass, removeClass } from "@vrembem/core";

// Usage
addClass(el, "some-class");

You can also include all core named exports under a namespace by importing the entire module’s contents:

// Import all named exports under the 'core' namespace
import * as core from "@vrembem/core";

// Usage
core.removeClass(el, "some-class");

Available named exports:

Name Description
addClass Adds a class or classes to an element or NodeList
camelCase Takes a hyphen cased string and converts it to camel case
hasClass Checks an element or NodeList whether they contain a class or classes
hyphenCase Takes a camel cased string and converts it to hyphen case
removeClass Remove a class or classes from an element or NodeList
toggleClass Toggle a class or classes on an element or NodeList
variables Exposes CSS variables in JavaScript