#428

Product support

Get help in the plugin support forum.

Categories

  • Developer Tools

This plugin provides a developer tool to generate complex CSS classnames in Twig templates in a way that makes them more readable.

It's a port of https://github.com/JedWatson/classnames but for PHP.

If you want a pure PHP version without plugin, please try: https://github.com/newridetech/php-classnames.

See the Documentation tab for details.

Try other

For more developer tools from the same author, please check:

Instead of:

<nav class="links {{ item.isActive ? 'links--active' : '' }} {{ item.type == 'primary' ? 'links--primary' : '' }} {{ item.extraClasses }}">
    ....
</nav>

Use:

<nav
    class="{{
        classnames('links', item.extraClasses, {
            'links--active': item.isActive,
            'links--primary': item.type == 'primary'
        })
    }}"
>
    ....
</nav>

And that's all. :) I hope it helps.


Plugin icon obtained from: https://www.freepik.com/free-icon/css-file-format-with-brackets_742124.htm#term=css&amp;page=1&amp;position=9

1.0.3

Update plugin composer dependencies

Sep 27, 2018

1.0.2

Bundle vendor libraries

May 07, 2018

1.0.1

First version of Classnames

Apr 25, 2018