Question

I'm wondering if anyone can recommend a good boilerplate file in .less to start a project with. Ideally this .less file would contain at minimum the following:

  • CSS Resets styles
  • CSS Normalizer styles
  • CSS3 Helpers (box radius, gradients, box shadow, transition)
  • Basic Colors Setup
  • Basic Styling for some common UI elements (buttons, tables, inputs, typography etc.)
  • Responsive images

I don't have much control over the markup, so I'm looking to write alot of custom attributes for classes that are already defined. Bootstrap and other popular libraries that require class definitions will not work for me. I'm hoping a markup agnostic boilerplate .less file will give me a good start.

Was it helpful?

Solution

Look at using less extend, bootstrap is still a great boilerplate. You can still take only the less files you want from it. You'd want normalize.less and mixins.less from the bootstrap project.

You can use extend to get whatever else you want out of bootstrap.

p {
    &:extend(.clearfix all);
}
img {
    &:extend(.img-responsive);
} 

or even

p {
   .clearfix;
}

If your worried about namespacing collisions you can try your hand at some global search and replaces. If you need that, I can try to help you with it. I wrote something a while back.

Of course you need the bootstrap project source for this - go here and click Download Zip - https://github.com/twbs/bootstrap

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top