Comments (8)
Is it decided what will be the class name for such element?
from material-components-web.
Those decisions won't be made until the component is actively being worked on.
from material-components-web.
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.
@histamineblkr would you mind linking to a code pen? The .mdc-button overrides the font styles of .material-icons
from material-components-web.
https://github.com/material-components/material-components-web/tree/master/packages/mdc-icon-toggle
from material-components-web.
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.
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.
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)
- Angular Material Tabs with sticky first tab
- The getting started guide: issues HOT 1
- [mdc-icon-button] unable to import core-styles mixin of icon-button as shown in documentation
- Unpkg: Source map for minified JS missing HOT 1
- MDCTopAppBar buttons ripple effect broken since 12.0.0 HOT 2
- Hi, I can't make a frame for the drawer, it's a problem
- Symmetric API for the Angular Material Icon Button HOT 1
- [MDCTextField] Trailing icons do not appear HOT 1
- the problem in running the program HOT 1
- [mdc-chip] css not applied to mdc-evolution-chip elements HOT 3
- Is there anyway we can force the dropdown select to always show below?
- [Chips] Filter chips not showing svg tick HOT 1
- `setAutovalidate()`/`getAutovalidate` name mismatch in readme
- Vertical mat-slider
- [mdc-theme] Contradicting advice on purpose of `$secondary`
- [Snackbar] screenreader leaves out "button" when reading message and action
- Tag for the version 14.1.0 is missing
- The release 14.1.0 isn't published on npmjs HOT 1
- Tone should work with css-variables
- [ALL] NPM packages are missing file extensions in ES6 exports
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from material-components-web.