Replace flux:textarea inline style with tailwindcss class#2629
Open
ghabriel25 wants to merge 2 commits into
Open
Replace flux:textarea inline style with tailwindcss class#2629ghabriel25 wants to merge 2 commits into
flux:textarea inline style with tailwindcss class#2629ghabriel25 wants to merge 2 commits into
Conversation
troccoli-sgr
reviewed
Jun 2, 2026
Comment on lines
+22
to
+28
| ->add($resize ? match ($resize) { | ||
| default => 'resize', // to prevent unhandled match type when user only provide the attribute without value | ||
| 'none' => 'resize-none', | ||
| 'both' => 'resize', | ||
| 'horizontal' => 'resize-x', | ||
| 'vertical' => 'resize-y', | ||
| } : 'resize-none') |
There was a problem hiding this comment.
I think this could be improved.
If $resize is not defined this would use resize-none but the original default was resize-y.
To make sure that $resize is always defined, and defaults to vertical, you can use
$resize ??= 'vertical';just before setting the classes, and maybe remove the default in the props.
Then this block can be simplified as
Suggested change
| ->add($resize ? match ($resize) { | |
| default => 'resize', // to prevent unhandled match type when user only provide the attribute without value | |
| 'none' => 'resize-none', | |
| 'both' => 'resize', | |
| 'horizontal' => 'resize-x', | |
| 'vertical' => 'resize-y', | |
| } : 'resize-none') | |
| ->add(match ($resize) { | |
| 'none' => 'resize-none', | |
| 'both' => 'resize', | |
| 'horizontal' => 'resize-x', | |
| 'vertical' => 'resize-y', | |
| default => 'resize-y' | |
| }) |
what do you thnk?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The scenario
Although I can't seem to reproduce this issue #2627, I think this might be better to use tailwind class on
flux:textareasince this style not exposed to Alpine likeflux:progressin #2512.We can revert it if this style need to be set dynamically using Alpine. I just never see the need of it, at least for me.
The problem
flux:textareacurrent template using inline style for resize type and field-sizing.The solution
Change inline style with tailwindcss class which can cover it all.
File Changes
stubs/resources/views/flux/textarea.blade.php