Live data from Hacker News

A modern responsive front-end framework based on Material Design

materializecss.com

21–30 of 96 posts

Re: A modern responsive front-end framework based on Material Design

#21
post #6
post #3

Earlier quoted context omitted.

It's so you don't clobber the underlying styles, otherwise you end up having to reset on top of the frameworks resets and styles on the odd occasion you want one of the collection li's to not have the styles. I tend to agree with you, but I was heavily chastised by lead the front end dev at my last gig for ever directly applying design styles to tag entities as doing it as above is considered best practice at the mom…

Tell your lead front dev this approach isn't best practice at all. You want one collection li's to not have the style? Use an alternative class on the ul: "collection collection-alt". You want nested li's to not inherit the styles? Use ".collection > li" in your CSS. In any case, assigning a class on each li goes exactly against CSS best practices, because it prevents taking advantage of the inheritance of property v…

Its bigger then li's it about an overall approach. In this use case, yes maybe its an overkill but in some cases its not and allows for quite a bit of flexibility to use the same styles across multiple element types.

I guess it's come about from trying to be more semantic within the documents.

Declaring Headings with classes is a good example as well.

    h1,
    .h1{
       font-size:20px;
    }

    h2,
    .h2{
       font-size:18px;
    }    
etc... This allows you to apply styles to or even

's while still keeping the content semantically correct and designers happy.

Another few other common ones are

    strong,
    .strong{
        font-weight:600;
    }

    small,
    .small{
        text-size:10px;
    }
The same can go with .collection, somebody may want to use the styles on something thats not a list for example 's.

It also does not really go against inheritance, themes like .collection-alt can still work.

Sometimes its an overkill and I don't always do it, but in some cases (heavily responsive sites) it has worked really well. Its also easier to work in a team with one approach, rather then just doing it for headings etc why not take the principle/standard across all styles.

Re: A modern responsive front-end framework based on Material Design

#22
post #16

Bootstrap material design has something similar, although it is not matured yet: https://github.com/FezVrasta/bootstrap-material-design

The main issue with bootstrap-material is that this project is afflicted by the dreaded "developer thinks he needs his own license" bug[0][1]. It's effectively CC BY-SA-NC which is rather bold when you consider that it's adopting a design framework from Google for a css framework from Twitter. [0] https://github.com/FezVrasta/bootstrap-material-design/blob/... [1] https://github.com/FezVrasta/bootstrap-material-desig…

+1. Saw this earlier, thought "looks good, I should use it for a project", then read license and went "hahahahhaha no chance, not using a normal/standard licence is way too high risk for me, no matter the project".

Re: A modern responsive front-end framework based on Material Design

#24

It's really cool. They use flexbox in some places! I don't understand why bootstap hasn't do that yet.

If it was not for the need to have a fallback for IE9 I would be using flexbox as standard, its a great feature with deals with so many of the common page layout issues, including vertical align.

Bootstrap is quite web focused still so I guess it will come when support for IE9 is not expected.

Though if you are doing an mobile/tablet only solution I would probably use flexbox only now. As long as you keep to the 2012 spec, you should be ok.

http://caniuse.com/#feat=flexbox

Bring on the death of IE9!!

Re: A modern responsive front-end framework based on Material Design

#25
post #6

Earlier quoted context omitted.

Tell your lead front dev this approach isn't best practice at all. You want one collection li's to not have the style? Use an alternative class on the ul: "collection collection-alt". You want nested li's to not inherit the styles? Use ".collection > li" in your CSS. In any case, assigning a class on each li goes exactly against CSS best practices, because it prevents taking advantage of the inheritance of property v…

Its bigger then li's it about an overall approach. In this use case, yes maybe its an overkill but in some cases its not and allows for quite a bit of flexibility to use the same styles across multiple element types. I guess it's come about from trying to be more semantic within the documents. Declaring Headings with classes is a good example as well. h1, .h1{ font-size:20px; } h2, .h2{ font-size:18px; } etc... This…

A more extreme example of this is http://www.basscss.com/ where CSS classes are reusable and composable. E.g. a list could be:

    
      Half-Smoke
      Kielbasa
      Bologna
      Prosciutto
   

Re: A modern responsive front-end framework based on Material Design

#26
post #5
post #3

Earlier quoted context omitted.

It's so you don't clobber the underlying styles, otherwise you end up having to reset on top of the frameworks resets and styles on the odd occasion you want one of the collection li's to not have the styles. I tend to agree with you, but I was heavily chastised by lead the front end dev at my last gig for ever directly applying design styles to tag entities as doing it as above is considered best practice at the mom…

>> but I was heavily chastised by lead the front end dev at my last gig for ever directly applying design styles to tag entities as doing it as above is considered best practice I'd say, keep it DRY [1]. http://en.wikipedia.org/wiki/Don't_repeat_yourself

It doesn't violate DRY. The repetition of "collection" is indicating a descendent component:

https://github.com/suitcss/suit/blob/master/doc/naming-conve...

Re: A modern responsive front-end framework based on Material Design

#27
This looks really nice, and I will try it in a project. The responsiveness doesn't seem to totally work though, perhaps an environment not tested.

Desktop:

I tried this by progressively shrinking my (desktop) browser window width to around 200px, and the main content seemed to get stuffed under the left menu with no responsive re-layout. [IE 11 on Windows 8.1].

Mobile:

I tried on my mobile (Android 4.4.2 480*800, Firefox - worked OK on default browser) the design was definitely for mobile (no problem like the above) apart from a ~20px white margin for the content on the right.

Re: A modern responsive front-end framework based on Material Design

#28
post #10
post #6

Earlier quoted context omitted.

Tell your lead front dev this approach isn't best practice at all. You want one collection li's to not have the style? Use an alternative class on the ul: "collection collection-alt". You want nested li's to not inherit the styles? Use ".collection > li" in your CSS. In any case, assigning a class on each li goes exactly against CSS best practices, because it prevents taking advantage of the inheritance of property v…

I dont do this repeating class business but CSS Tricks 'css guidelines' web page says that when you do : '.collection li', it first searches through the page for all 'li's then wittles it down to the ones within the correct parent. Essentially that css selectors work from right to left. So I guess the idea is that classing up the li elements within a parent may be marginally quicker? I have never bothered though. Doe…

It used to be the issue in the "old browsers", modern browsers optimize the css query selectors to a very high extent, so users probably won't see a difference on any real web page / app

Re: A modern responsive front-end framework based on Material Design

#30
post #17

Earlier quoted context omitted.

>> I think the whole community went to separating the HTML tag names from the styles and work only with class names [1]. I don't usually nitpick but I don't think one link is representative of the `whole community`. Just this thread seems to prove it's pretty divided on the issue. What is the recommendation, then? .collection .collection-item .collection-item-anchor? Genuinely curious here.

References : [1] http://www.smashingmagazine.com/2011/12/12/an-introduction-t... [2] http://bramsmulders.com/how-i-improved-my-workflow-with-smac... [3] https://github.com/davidtheclark/scalable-css-reading-list I don't usually reply in this way, but this way of writing CSS has been proven to me in many hard to predict situations and is something that I would fight for in every possible way, everywhere I can. :D I've…

OOCSS, BEM and staff like that is just abuse of CSS. It is however widely used, because people are too lazy.
Post reply on HN