top | item 9840682

Material Design Lite Components in HTML/CSS/JS

295 points| vladikoff | 10 years ago |github.com

73 comments

order
[+] dstaley|10 years ago|reply
So, I just wanna say I am absolutely, incredibly excited for this. I've loved the design of paper-elements, but I don't want to attempt integrating Polymer into my projects.

That being said, the use of BEM is a huge turn off. The markup for a simple card uses seventeen different classes, which is absolutely a nightmare to memorize. For comparison, a card from Materialize uses only five to seven classes (depending on the type of card).

However, since this is built in SASS, I assume you could use the extend keyword to combine a lot of the frequently used together classes into something more manageable. I haven't really used SASS in this way, so I'm not sure how that'd work.

[+] addy_osmani|10 years ago|reply
Thanks for the feedback. We used BEM as we find it helps with the long-term maintainability of CSS/SASS codebases (there's also copy/paste support on all of our snippets). That said, if you find the use of BEM a turn-off, we welcome folks just taking our styles and adapting them to the naming scheme that makes most sense for them. Anything that helps.
[+] spankalee|10 years ago|reply
I'm curious, what's keeping you from trying Polymer? Its paper-elements are a very good implementation of Material Design, and the library is very light weight.
[+] ArthurClemens|10 years ago|reply
Great news that Google has started this library. This will help MD implementors like me.

"That said, the large, diverse number of implementations available are often quite liberal with their interpretation of the spec (not their fault!) and their opinions don’t always reflect what the Material Design team would consider ‘correct’."

Nevertheless I found a number of deviations from the design specs:

  - Disabled buttons should not have a z level
  - FAB ripples should originate from the center
  - Icon buttons should have a touch area of at least 40px
  - The same goes for slider knobs (at least 30px, already small)
On the website:

  - The scrollable tabs on the site are scrolled just a couple of pixels per arrow click, instead of scrolled per tab
  - Scroll areas should have -webkit-overflow-scrolling: touch, the current site is not scrollable on Mobile Safari
Author of Polythene for Mithril, https://github.com/ArthurClemens/Polythene
[+] addy_osmani|10 years ago|reply
I'm almost certain our implementation isn't perfect :) We'll file bugs for the items you called out above and try to get them fixed up shortly.
[+] matthijs_|10 years ago|reply
Great implementation of Material Design, the best I've seen so far. With other material design implementations [1] I ran into problems with checkboxes, sliders and other design choices, as well as problems on mobile. I appreciate the design choices made for MDL. It also runs smooth on mobile and the form elements like checkboxes and sliders work really nice.

Also, useful documentation along with codepen and easy clipboard buttons.

Following.

[1] To name a few material design examples: http://superdevresources.com/material-design-web-ui-framewor...

[+] TranquilMarmot|10 years ago|reply
Well, it was made by Google, who originally defined Material Design in the first place, so I'd hope it would be the best one...
[+] qwreasdfkjhiouy|10 years ago|reply
I have to say, I really dislike the appearance of material design.
[+] mattmanser|10 years ago|reply
The ripples drive me crazy. Everytime I click a button my mind gets yanked into "what just went wrong?" because of the inconsistent nature of the ripples. Even though I know it's going to happen.
[+] bluthru|10 years ago|reply
At times it feels like a Flash site from 15 years ago--too much animation and it can be really heavy-handed.
[+] zvrba|10 years ago|reply
I dislike the abundance of color schemes with low saturation. This lower contrast, and I can imagine I'd have to turn up screen backlight to the max if I used it in sunlight.

I tried to use colleague's android and I found it unintuitive to use too (it wasn't obvious what elements you can interact with, and animations were annoying).

(I'm a WP user and it's THE UI I like best.)

[+] frik|10 years ago|reply
It's like saying in a Windows 10 thread you dislike the MetroUI/ModernUI design.

I prefer the material design in Android 5+. And I like the iOS 7+ design and Win7 Aero design. But I cannot live with the ModernUI of Win8/XboxOne - who choose those ugly colors?

[+] Saturnaut|10 years ago|reply
I think we need to be careful of treating Material as an all encompassing solution. A lot of UI / UX folks I know are full on embracing it without taking a step back and seriously evaluating what problems it will and won't solve. I'm not saying I dislike it, I just think that there are different solutions for different situations. There is no silver bullet in our industry.
[+] philtar|10 years ago|reply
I'm genuinely curious: This looks very lame. Why are the commenters excited? Not trying to offend I'm mean lame as pragmatically as possible.
[+] philliphaydon|10 years ago|reply
I was thinking the same. I initially thought based on the name I could pick a single component to use but its an entire framework, so it still suffers from bloat.
[+] okpatil|10 years ago|reply
It might be brand "GOOGLE" that is getting them excited
[+] Aldo_MX|10 years ago|reply
I loved that in contrast with the other Material Design Toolkits, this one uses only CSS for its animations.
[+] andybak|10 years ago|reply
Are you saying that's a good thing mainly for performance reasons?

I ask mainly because I vaguely remember someone running the numbers and finding out that js animations surprisingly beat CSS animations in a number of not-unrealistic scenarios.

(I know there's other reasons for favouring CSS animations)

[+] TheSisb2|10 years ago|reply
I love the design, but I'm finding a lot of the animations aren't smooth. I'm on Chrome 43.
[+] addy_osmani|10 years ago|reply
If there are any animations at all you find are janky, could you file and we'll look at it soon? We've been performance testing on a wide range of devices/browsers but I'm certain there are plenty of areas we can improve on.
[+] weitzj|10 years ago|reply
I agree. The site does not scroll 'natively' (has inertia) on iOS 8.3 (iPad 3)
[+] vijayr|10 years ago|reply
What are the differences between this one and http://materializecss.com/ ?
[+] JohnTHaller|10 years ago|reply
Materialize seems to work much better in Firefox than MDL, especially on Android.
[+] spoiler|10 years ago|reply
I love this! I've been meaning to make something like this myself for a project; now I won't have to.

I have to point out some flaws, though; for example the side menu here[1] has very low text contrast once you hove over them.

[1]: http://www.getmdl.io/templates/dashboard/index.html

[+] addy_osmani|10 years ago|reply
Lead for MDL here. Glad you like the idea, spoiler :) Thanks for catching the low contrast issue with the dashboard navigation - is it the same as https://github.com/google/material-design-lite/issues/739?. If not, would you mind filing an issue on the repo and we'll try to get that fixed up soon?

https://github.com/google/material-design-lite/blob/master/C...

Alternatively, we can file a bug for you if you share details about the browser/os/device you were testing on.

[+] Zikes|10 years ago|reply
I think that's worth filing an issue for.
[+] freyr|10 years ago|reply
The Material Design Lite website (http://www.getmdl.io) breaks scroll behavior on mobile Safari.

If you're promoting a UI/UX product, you really shouldn't be bungling scrolling. Because if you can't get your own site working well, I'm not trusting your libraries on my site.

[+] asurma|10 years ago|reply
We just rolled out a fix for that :)
[+] sancha_|10 years ago|reply
Haven't you heard, Safari is the new IE.
[+] bikas|10 years ago|reply
Ohh the BEM bummer. All those __ and -- makes my eye hurt. Write decent line of code in HTML file with BEM classes and it looks worse than inline styles (visually). For the rest of library, I'm still trying and testing, but I don't think I'll be moving any of my main projects to this library because of BEM.
[+] ConAntonakos|10 years ago|reply
Thank you for this. I still feel like the Material Design implementation within Polymer is rough around the edges. Having issues with Firefox, for example, in terms of optimization and documentation is still very incomplete. Looking forward to working with both libraries, though!
[+] LoSboccacc|10 years ago|reply
Outstanding library. I like this version of material more than the other with polimer that's completeley flat.

There are some issues with scrolling in general and with scrolling with tooltips open on ios, but will follow and see if they eventually get around those.

[+] gbrits|10 years ago|reply
Rigorous implementation of the specs, with well managed css (BEM) to boot. Render me excited!
[+] _ari|10 years ago|reply
If only this had dropdown/selection menus. I probably would have used it in a project.
[+] pan69|10 years ago|reply
Agreed. This project is awesome but without usable form elements (there's more to forms that text fields) this isn't really usable for anything a little more complex.
[+] rtpg|10 years ago|reply
Is it just me or do a lot of these components lack the depth perception aspect of other material design things?

Depth is such an important part of the nice look of Material Design that not having it seems like a big mistake

[+] ranyefet|10 years ago|reply
It's looks great. Nice job! One problem I had with site is that the scrolling is unusable on mobile safari. Would be great if you could fix that.
[+] asurma|10 years ago|reply
Sorry it’s making the site unusable. Fix is incoming. See @thirdsun’s comment and my answer for details.