Looks great. However, I've never really understood this sort of approach: Alvin Alvin Alvin Alvin Rather than assigning a "collection-item" class to each "li", would you not simply style the "li" in the context of "collection"? Bootstrap does a similar thing. Drives me nuts...
There's a reasoning behind this. You may not agree with it, but it's good to fully understand the problem it's trying to solve. There are two problems with your suggested approach -- specificity and coupling. The rules of CSS are such that .collection > li is a more specific selector than .collection-item. So if you want a particular item in the list to be red, you can't just give it a class name .warning-item and st…
A modern responsive front-end framework based on Material Design
61–70 of 96 posts
Re: A modern responsive front-end framework based on Material Design
#62Looks great. However, I've never really understood this sort of approach: Alvin Alvin Alvin Alvin Rather than assigning a "collection-item" class to each "li", would you not simply style the "li" in the context of "collection"? Bootstrap does a similar thing. Drives me nuts...
Re: A modern responsive front-end framework based on Material Design
#63Re: A modern responsive front-end framework based on Material Design
#64Re: A modern responsive front-end framework based on Material Design
#65Earlier quoted context omitted.
HTML provides nesting. Nesting indicates it is a descendent component. This would violate DRY.
LIs are generic containers--the only way to narrowly scope LIs is to use hierarchical selectors, which leads location dependency and specificity issues. The class name creates a scope and you need to apply that to decedent components to enforce the scope. It's DRY within the naming convention, which doesn't mix element selectors with class selectors (or at least rarely).
LIs are actually kinda special. It's incredibly difficult to create your own LI in, say, web components because of their specialness (at least I've never seen it work in all browsers though there are probably some crazy hacks to get it there (or at least close enough)).
> which leads location dependency and specificity issues
You have a list of a specific type so you put a class on it. Why would that specific type of list now contain items that can be used in multiple places versus in that specific list and why would they ever be moved from that specific type of list? I don't really understand the issue you're trying to convey.
Re: A modern responsive front-end framework based on Material Design
#66- The required HTML classes seemed kinda bloated and not semantic, but I intended to fix that with Sass (well, officially they're on Less)
- The input elements have weird animation on page load
- When I just dropped in some basic elements, like an input field (with its wrappers) nothing was really working. Things were not properly aligned and I had to add all this container/row/column stuff, even though I just came for the widgets
And last but not least what made me finally ditch it:
- To display form validation errors, I have to supply a data-error attribute which will then get rendered via css as a pseudo ::after to the label. That is just weird. I then checked how it works without JavaScript and saw labels overlapping placeholders.
It looks beautiful and I like how comprehensive it is. Really hope they'll improve on some of these technical flaws.
Re: A modern responsive front-end framework based on Material Design
#67Earlier quoted context omitted.
What? Why? I personally find Material to be hideous because of its color abuse. It makes your UI look like an over-saturated Fischer-Price toy because of all the bright primary colors everywhere, and that's before we get into the lack of shadow and shading that seems to have infected "modern" design.
I'll take the opposite side - pastel colors are horrible and disgusting. I can't imagine why anyone would like pastel colors.
I like my user interfaces black and white - you know, like on an amber monitor.
/s
Re: A modern responsive front-end framework based on Material Design
#68Earlier quoted context omitted.
I don't agree with this. Do you have some references about your statement. I think the whole community went to separating the HTML tag names from the styles and work only with class names [1]. If you start styling your tags directly it imminently increase the code debt if you scale. Let's say you just want to add another element inside the tag. I can give you example : .collection > li { color: red; } and later on yo…
Thank you for pointing to the interesting BEM article. As to this specific case, though, I was surprised to see your "this will not work" comment and tested it. It worked: http://jsfiddle.net/brlewis/p0Locwgp/
Is red
Should be blue
.collection > li { color: red; }
.collection-special { color: blue; }
http://jsbin.com/tulenoxutu/1/edit?html,css,outputRe: A modern responsive front-end framework based on Material Design
#69This framework really impressed me when I first saw it and made me immediately wanna use it. However, when I took a closer look I found a few things that annoyed me: - The required HTML classes seemed kinda bloated and not semantic, but I intended to fix that with Sass (well, officially they're on Less) - The input elements have weird animation on page load - When I just dropped in some basic elements, like an input…
Re: A modern responsive front-end framework based on Material Design
#70Earlier quoted context omitted.
There's a reasoning behind this. You may not agree with it, but it's good to fully understand the problem it's trying to solve. There are two problems with your suggested approach -- specificity and coupling. The rules of CSS are such that .collection > li is a more specific selector than .collection-item. So if you want a particular item in the list to be red, you can't just give it a class name .warning-item and st…
Performance is penalized too. Since CSS rules are parsed from right to left and you have probably a lot of "li" tags, the rule would be very inefficient. Of course this doesn't matter in small pages.