packagefactory/atomicfusion-classnames

Last activity 23 Aug 2023 2 72275
composer require packagefactory/atomicfusion-classnames

ÈEl Helper for rendering of classNames in atomic fusion

v1.0.2

Version
v1.0.2
Type
neos-package
Release Date
Apr 01, 2022 12:35
Source
git
Distribution
zip
Requires
  • neos/fusion: ^3.3 || ^4.0 || ^5.0 || ^7.0 || ^8.0 || dev-master
GPL-3.0 a1d61bb0f2ee3c869c72bb937f31c386bbf78725

PackageFactory.AtomicFusion.ClassNames

ÈEl Helper for rendering of classNames in atomic fusion

EEL-Helpers

  • AtomicFusion.classNames: render all arguments as classNames and apply conditions if needed

All arguments of the AtomicFusion.classNames eelHelper are evaluated and the following rules are applied

  • falsy values: (null, '', [], {}) are not rendererd
  • array: all items that are scalar and truthy are rendered as class-name
  • object: keys that have a truthy values are rendered as class-name
  • scalar: is cast to string and rendered as class-name

Usage

1. Component definition

prototype(Vendor.Site:Component) < prototype(Neos.Fusion:Component) {
    renderer = afx`
        <div class={AtomicFusion.classNames('component' , {'component--bold': props.bold})}>
            {props.content}
        </div>
    `
}

Installation

PackageFactory.AtomicFusion is available via packagist. Just run composer require packagefactory/atomicfusion-classnames.

We use semantic-versioning so every breaking change will increase the major-version number.

License

see LICENSE file

The content of the readme is provided by Github
The same vendor provides 7 package(s).