Giter VIP home page Giter VIP logo

Comments (8)

piotr-cz avatar piotr-cz commented on May 19, 2024

Is it decided what will be the class name for such element?

from material-components-web.

Garbee avatar Garbee commented on May 19, 2024

Those decisions won't be made until the component is actively being worked on.

from material-components-web.

histamineblkr avatar histamineblkr commented on May 19, 2024

Couldn't Find an Icon/Fab Button

It looks like this is still open and I figured out a reasonably simple work around. Hopefully this will help anyone in the mean time.

Create MdcButton

You can create an mdc-button:

<button class="mdc-button">
  shopping_cart
</button>

Add Classes to MdcButton and Material Icon

Add whatever button classes you desire. Then add the following two classes (material-icons, icon-color):

<button class="mdc-button mdc-ripple--upgraded material-icons icon-color">
  shopping_cart
</button>

color-icon is just CSS to color the icon to match. If you just use material-icons it will be black and if you use material-icons or material-icons__menu the padding will be off.

Add Color Icon CSS Class

I added color this way and took out the before and after highlighting. You can customize as you see fit here:

.icon-color {
  color: $yourColor;
}
.icon-button, .icon-button::before, .icon-button::after {
  background-color: rgba(0, 0, 0, 0)
}

I don't know if this will help anyone, but hopefully it does.

from material-components-web.

aaronhudon avatar aaronhudon commented on May 19, 2024

@histamineblkr would you mind linking to a code pen? The .mdc-button overrides the font styles of .material-icons

from material-components-web.

dessant avatar dessant commented on May 19, 2024

https://github.com/material-components/material-components-web/tree/master/packages/mdc-icon-toggle

from material-components-web.

theophanemayaud avatar theophanemayaud commented on May 19, 2024

Still no implementation ... ? @dessant well that was exactly not the problem... !
I think the ripple effect and button enabled/disabled... are indeed, as the spec says, necessary for "icons butons" so to say. For menu, or language, or other icons used as buttons ! Workarounds using icons are not perfect...

from material-components-web.

zunamo avatar zunamo commented on May 19, 2024

Is this still on the roadmap in any way?

According to the official material.io website, this is part of the button component which says it is implemented:
https://material.io/design/components/buttons.html#toggle-button
https://material.io/design/components/buttons.html#implementation
But this does not seem to be the case.

from material-components-web.

cpboyd avatar cpboyd commented on May 19, 2024

For what it's worth, Angular Material has a Button Toggle group that handles single/multi selects: https://material.angular.io/components/button-toggle/

I think long-term, they're trying to utilize MDC: https://github.com/angular/components/projects/25

Granted, they could always just utilize the icon-button and keep the group logic in Angular.

It'd be nice to have an official MDC implementation for sites not using Angular.

from material-components-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.