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

Switch tag doesn't allow : character causing issues with Tailwind #1742

Closed
aryehraber opened this Issue Jan 22, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@aryehraber

aryehraber commented Jan 22, 2018

The Switch tag (called Rotate in {{S}} core) has an (undocumented) feature called "expanded mode" which uses a : character as a delimiter.

This only recently became an issue since I started using Tailwind which uses : for responsive classes.

Example:

<div class="flex {{ switch between='lg:flex-row|lg:flex-row-reverse' }}">
    <!-- Alternating awesomeness goes here -->
</div>

It'd be great to make this feature optional, or at least allow a param to be passed through to override the default : from being used.

Possible solution inside RotateTags.php:

// line 23
$expanded_mode = strstr($between, $this->get('delimiter', ':'));

// line 59
$repeating_values = explode($this->get('delimiter', ':'), $value);
@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 22, 2018

For the time being, it looks like you can use an entity for the colon.

{{ switch between='lg&#58;flex-row|lg&#58;flex-row-reverse' }}

@jackmcdade jackmcdade self-assigned this Jun 5, 2018

@jackmcdade jackmcdade closed this Jun 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment