Elentra JS Documentation
2.0
2.0
  • Introduction
  • Why Elentra JS 2.0?
    • Dedicated Repository
    • TypeScript
    • Class-Based Components
    • Vue Standard Routing
    • Organizational Theming
    • Yarn Package Manager
  • Developers
    • Getting Started
    • Setup Guide
      • Install Requirements
      • Clone the Repository
      • Environment Variables
      • Install Dependencies
      • Serve Dev Mode
  • Design System
    • Overview
    • Component Library
      • Directory Structure
      • Components
    • Style Library
      • Directory Structure
      • How it Works
        • Variables
        • Mixins
        • Utility Classes
        • Elements
        • Legacy Styles
        • Shim
    • Taxonomy
      • UI Taxonomy
      • UX Taxonomy
      • Variable & Utility Class Naming Convention
Powered by GitBook
On this page
  1. Design System
  2. Style Library
  3. How it Works

Mixins

_mixins.scss

This SCSS partial simply defines various functions and mixins in SCSS that are used in various places throughout Elentra JS.

The most important function to be aware of is our color function, ejsc(), which accepts two parameters, with the second being an optional transparency/alpha decimal value. When working in any component that needs to make use of the Elentra JS Design System color variables, make sure that the following import statements are present at the top of your <style lang="scss"> tag set:

Proper Import Declarations
<style lang="scss">
@import '@/styles/_variables.scss';
@import '@/styles/_mixins.scss';
...
</style>

Once those two files are imported into your component, you will have access to the color variables themselves, as well as the ability to pass them to the ejsc() function as below:

div.example {
    background-color: ejsc($ejs-color-brand--primary);    /*       Solid */
    color: ejsc($ejs-color-brand--secondary, .5);         /* 50% Opacity */
}
PreviousVariablesNextUtility Classes

Last updated 5 years ago