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

Modify styling when a Tab is disabled. #1752

Closed
eugbyte opened this issue Jul 15, 2023 · 3 comments
Closed

Modify styling when a Tab is disabled. #1752

eugbyte opened this issue Jul 15, 2023 · 3 comments
Labels
feature request Request a feature or introduce and update to the project.

Comments

@eugbyte
Copy link

eugbyte commented Jul 15, 2023

Describe the feature in detail (code, mocks, or screenshots encouraged)

As per title.

It is possible to reduces the opacity of the element, when setting the component to disable={true}.

Similar to the tailwind Button component.

What type of pull request would this be?

Enhancement

Provide relevant links or additional information.

Similar to the tailwind Button component.

@eugbyte eugbyte added the feature request Request a feature or introduce and update to the project. label Jul 15, 2023
@endigo9740
Copy link
Contributor

endigo9740 commented Sep 8, 2023

Quick updated on this. I've taken a look at what level of effort would look like to implement this. We'll likely tackle this alongside these planned a11y-focused improvements:

The reason being is that currently the normal Tab component uses an html structure like this:

<label>
    <div>...</div>
</label>

The more appropriate structure for a11y would be something more like this:

<label>
    <button>...</button>
</label>

However, we have a lot of overall tab styling applied via the outer-most element (the label) where as this should likely be applied to the button instead. By doing this, we can likely implement something like this:

<button disabled={prunedRestProps().disabled}>

Otherwise we have to implement this change in multiple places (visually on label; functionally on button). With the small refactor coming from the a11y changes, I think it'll be best to handle all this at once in the near future.

@eugbyte
Copy link
Author

eugbyte commented Sep 9, 2023

The workaround that I have is to manually style the regionTab like so:

        <Tab
		bind:group={tabSet}
		value={-1}
		name="current_location"
		disabled
		regionTab="hover:cursor-not-allowed opacity-50"
	>
		<Icon slot="lead" data={userCircle} scale={2} />
	</Tab>

@eugbyte
Copy link
Author

eugbyte commented Sep 9, 2023

Will wait for the update

@eugbyte eugbyte closed this as completed Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a feature or introduce and update to the project.
Projects
None yet
Development

No branches or pull requests

2 participants