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

[typhoon] [question] Tailwind CSS - flex-no-wrap is not applied correctly in modular/image-block.html.twig #395

Open
sebastian0119 opened this issue Nov 1, 2023 · 1 comment
Assignees
Labels
typhoon Typhoon theme

Comments

@sebastian0119
Copy link

Hi there,

I am using Grav 8.1.12 with the latest Typhoon theme.

I am trying to adjust the modular/image-block.html.twig template, which originally looks like that (extract):

<div class="flex {{ align_right ? 'md:flex-row-reverse' : '' }} justify-center md:justify-start flex-wrap md:flex-no-wrap">
    {% if image %}
      <div class="w-full md:w-1/2 {{ align_right ? 'md:pl-8': 'md:pr-8' }} {{ page.header.image_classes }}">
        <img class="mb-8 md:mb-0 rounded-md" alt="{{ image }}" src="{{ image }}">
      </div>
    {% endif %}
    <div class="w-full md:w-1/2 {{ align_right ? 'md:pr-8': 'md:pl-8' }} md:pr-8 mb-4 md:mb-0">

      {% if page.content %}
        <div class="md:text-lg prose">
          {{ page.content|raw }}
        </div>
      {% endif %}
</div>

In my interpretation, it should not wrap flex items for medium screen and larger (flex-wrap md:flex-no-wrap on the parent div).

But when I try to change the width of image and content from md:w-1/2 (each) to md:w-2/3 for the image and md:w-1/3 for the content, these two items do get wrapped.

If you consider that this issues is more an issue of Tailwind and not so much of Grav + Typhoon, please feel free to close this issue.

Thanks,
Sebastian

@sebastian0119 sebastian0119 added the typhoon Typhoon theme label Nov 1, 2023
@rhukster
Copy link
Member

rhukster commented Nov 6, 2023

You need to make sure you are recompiling Tailwind CSS when you make changes that are using a new class. This is because Tailiwind rebuilds the CSS to use ONLY the CSS you are using. It doesn't include everything by default.

The docs have some instructions on how to get this 'watching' for changes: https://getgrav.org/premium/typhoon/docs#developing-custom-css

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typhoon Typhoon theme
Projects
None yet
Development

No branches or pull requests

2 participants