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

Refactor font-bold and underline #52

Merged
merged 2 commits into from
Oct 13, 2021

Conversation

xiCO2k
Copy link
Collaborator

@xiCO2k xiCO2k commented Oct 13, 2021

To avoid interfering with the prepend(), changed the classes font-bold and underline

Code

render(<<<'HTML'
    <div class="my-1">
        <span>For text on 🍃 Termwind we support:</span>
        <ul class="mt-2">
            <li class="font-bold text-color-white">
                Font Bold
            </li>
            <li class="italic text-color-white">
                Italic
            </li>
            <li class="underline text-color-white">
                Underline
            </li>
            <li class="line-through text-color-white">
                Line Through
            </li>
            <li class="font-bold italic text-color-white underline line-through">
                All Together
            </li>
        </ul>
    </div>
HTML);

Before

image

After

image

@nunomaduro
Copy link
Owner

Coverage is failing, can you check?

@xiCO2k
Copy link
Collaborator Author

xiCO2k commented Oct 13, 2021

Yes to not remove the options completely since there may be cases that we will use it, added the coverage ignore for that.

// @codeCoverageIgnoreStart
foreach ($this->properties['options'] as $option) {
    $options[] = $option;
}
// @codeCoverageIgnoreEnd

if you want to remove it completely let me know.

@nunomaduro
Copy link
Owner

If we are not using them, remove it.

@xiCO2k
Copy link
Collaborator Author

xiCO2k commented Oct 13, 2021

Got it.

@xiCO2k xiCO2k force-pushed the refactor-bold-and-underline branch from 3e8c717 to 0fd3015 Compare October 13, 2021 14:47
@nunomaduro nunomaduro merged commit 4f46f04 into nunomaduro:master Oct 13, 2021
@sebdesign
Copy link
Contributor

sebdesign commented Oct 13, 2021

This PR breaks methods which modify the content, e.g.: truncate, uppercase, capitalize, snakecase, because the options are now hardcoded into the content.

E.g. <div class="font-bold uppercase">text</div> renders <bg=default;options=>\e[1MTEXT\e[0M</>.

@xiCO2k
Copy link
Collaborator Author

xiCO2k commented Oct 13, 2021

@sebdesign Thanks for catching it.

We have other ones like invisible, line-through that will have the same problem with text mutation.

Can you create an issue with that information?

Thanks.

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

Successfully merging this pull request may close these issues.

None yet

4 participants