Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(web-twig): Do not render CSS property in the GridItem style attribute if the value is empty #1235

Merged

Conversation

dlouhak
Copy link
Contributor

@dlouhak dlouhak commented Jan 16, 2024

I was going around… Small nitpicking. ✨ ⛏️

When we needed to send a null value to a prop, the CSS property was generated without an assigned value.

Source code from Jobs.cz

<GridItem
      columnStart="{{ gridItemColumnStart ? gridItemColumnStart[loop.index] : null }}"
      columnEnd="{{ gridItemColumnEnd ? gridItemColumnEnd[loop.index] : null }}"
      rowStart="{{ gridItemRowStart ? gridItemRowStart[loop.index] : null }}"
      rowEnd="{{ gridItemRowEnd ? gridItemRowEnd[loop.index] : null }}"
  >
      <MedallionGalleryImage image="{{ image }}" />
  </GridItem>

😞 Current output

<div
    class="GridItem"
    style="--grid-item-column-start: ;--grid-item-column-end: ;--grid-item-row-start: ;--grid-item-row-end: ;"
>...</div>

Upcoming output

<div class="GridItem">...</div>

@dlouhak dlouhak self-assigned this Jan 16, 2024
Copy link

netlify bot commented Jan 16, 2024

Deploy Preview for spirit-design-system-validations canceled.

Name Link
🔨 Latest commit fcf2b59
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-validations/deploys/65a69f025f4be20008b581a8

Copy link

netlify bot commented Jan 16, 2024

Deploy Preview for spirit-design-system-storybook canceled.

Name Link
🔨 Latest commit fcf2b59
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-storybook/deploys/65a69f02a6e00f0008bcd6c9

Copy link

netlify bot commented Jan 16, 2024

Deploy Preview for spirit-design-system-react canceled.

Name Link
🔨 Latest commit fcf2b59
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-react/deploys/65a69f02fcd95b0008fdca14

@github-actions github-actions bot added the feature New feature or request label Jan 16, 2024
Copy link

netlify bot commented Jan 16, 2024

Deploy Preview for spirit-design-system-demo canceled.

Name Link
🔨 Latest commit fcf2b59
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-demo/deploys/65a69f02f44112000887d770

@coveralls
Copy link

Coverage Status

coverage: 96.491%. remained the same
when pulling fcf2b59 on feature/griditem-do-not-render-style-attribute-with-empty-value
into b1d558b on main.

Copy link
Collaborator

@literat literat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thanks a lot :-)

@literat literat merged commit 146a21c into main Jan 17, 2024
33 checks passed
@literat literat deleted the feature/griditem-do-not-render-style-attribute-with-empty-value branch January 17, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants