Skip to content

Commit

Permalink
Remove twig references to is same as() to pass Octane linter (#917)
Browse files Browse the repository at this point in the history
  • Loading branch information
illepic authored Jul 27, 2020
1 parent bab436c commit e0932a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@
</thead>
<tbody>
{% for key, value in tokens.borderWidth %}
{% set borderClass = key is not same as('default') ? 'border-' ~ key : 'border' %}
{# Normally we'd solve this with `is same as()`, but we're working #}
{# around a twig linter here. #}
{% set borderClass = 'border-' ~ key %}
{% set borderClass = borderClass == 'border-default' ? 'border' : borderClass %}

<tr>
<td class="{{ tdClasses }}">
<span class="{{ codeClasses }}">{{ borderClass }}</span>
Expand Down
4 changes: 1 addition & 3 deletions source/default/_patterns/01-atoms/grid/_grid.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
grid_classes|default([])|merge(['grid', grid.container ? 'container' : '', grid.center ? 'mx-auto' : ''])
%}

{% set column_classes =
column_classes|default([])|merge(['flex', grid.wrap is same as(false) ? '' : 'flex-wrap'])|join(' ')|trim
%}
{% set column_classes = column_classes|default([])|merge(['flex', grid.wrap ?? 'flex-wrap'])|join(' ')|trim %}

<div {{ grid_attributes is not empty ? grid_attributes|attributify : '' }} class="{{ grid_classes|join(' ')|trim }}">
<div class="{{ column_classes }}">
Expand Down

0 comments on commit e0932a4

Please sign in to comment.