From e0932a46941b8cb9ad4b2eecaed8d7c32de83667 Mon Sep 17 00:00:00 2001 From: Christopher Bloom Date: Mon, 27 Jul 2020 15:09:19 -0700 Subject: [PATCH] Remove twig references to is same as() to pass Octane linter (#917) --- .../pattern-lab/_patterns/00-protons-demo/borders.twig | 6 +++++- source/default/_patterns/01-atoms/grid/_grid.twig | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/pl-default/pattern-lab/_patterns/00-protons-demo/borders.twig b/apps/pl-default/pattern-lab/_patterns/00-protons-demo/borders.twig index e3c40ca3c8..785c72c0e1 100644 --- a/apps/pl-default/pattern-lab/_patterns/00-protons-demo/borders.twig +++ b/apps/pl-default/pattern-lab/_patterns/00-protons-demo/borders.twig @@ -84,7 +84,11 @@ {% 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 %} + {{ borderClass }} diff --git a/source/default/_patterns/01-atoms/grid/_grid.twig b/source/default/_patterns/01-atoms/grid/_grid.twig index cae953e850..93e5de2e16 100644 --- a/source/default/_patterns/01-atoms/grid/_grid.twig +++ b/source/default/_patterns/01-atoms/grid/_grid.twig @@ -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 %}