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

Action button out of the box support for vue material design icons #1613

Closed
PVince81 opened this issue Nov 27, 2020 · 5 comments
Closed

Action button out of the box support for vue material design icons #1613

PVince81 opened this issue Nov 27, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@PVince81
Copy link
Contributor

PVince81 commented Nov 27, 2020

As I understood, we want to move to material design icons as per #1051

Currently when using icons from the vue material design icons library, the style doesn't fit:

This is an action button inside a menu (on my branch nextcloud/spreed#4569):

				<ActionButton
					v-shortkey="['h']"
					:close-after-click="true"
					@shortkey="toggleHandRaised"
					@click="toggleHandRaised">
					<Hand
						slot="icon"
						class="action-button__icon"
						:size="24"
						fill-color="#000000"
						decorative
						title="" />
					{{ raiseHandButtonLabel }}
				</ActionButton>

where Hand comes from import Hand from 'vue-material-design-icons/Hand'

With the above, the menu looks like this:
image

it is not centered, probably because of background-size not being usable with that svg element.

I tried bumping its size to 44px to match the other icon sizes but then the hand becomes huge:
image

In any case, as a consumer I shouldn't have to tinker with the styles.
Ideally we could define some styles that are based on the generated "material-design-icon" SVG.

@PVince81 PVince81 added the bug Something isn't working label Nov 27, 2020
@PVince81
Copy link
Contributor Author

it appears that setting "vertical-align: middle" on the svg centers it correctly.

so we should add a rule for it.

@PVince81
Copy link
Contributor Author

I guess even better would be to have a property :material-design-icon to provide a name and the required extra attributes are all taken care of.

@PVince81
Copy link
Contributor Author

PR here for a quick fix: #1614

we need it because the ActionButton consumer cannot override the styles with ::v-deep since the popover itself might be in the document body

@juliusknorr
Copy link
Contributor

I guess even better would be to have a property :material-design-icon to provide a name and the required extra attributes are all taken care of.

I talked about this with @ma12-co in the past and I cannot see a way we can make this happen without bundling all material design icons in the library. What we would need is a way to let the library keep those as as es6 imports so that they would be bundled by the app in the end somehow, but I could figure out any way to do so.

Though I'd say that is something for a separate issue if we really want to tackle it at some point.

@juliusknorr
Copy link
Contributor

Fixed by #1614

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants