Discuss This Topic
There are 1 comments in this discussion.
Read and join this discussion
url: http://ruby.bvision.com/blog/please-stop-embedding-bootstrap-classes-in-your-html
An argument for not polluting your HTML, which should be semantic, with Bootstrap (or any other CSS framework) classes as well as a demonstration how you would workaround the need to specify Bootstrap specific classes to take avantage of Bootstrap functionality.
anonymous
said Trying to stop embedding bootstrap classes does not work
I wanted all of the data tables in my application to be styled with bootstrap classes .table, .table-bordered, .table-striped, .table-condensed, so I made one class I call .datagrid and tried to incorporate those bootstrap classes so:
.datagrid {
.table;
.table-bordered;
.table-striped;
.table-condensed;
}
However, less throws errors that it cannot find .table-striped or .table-condensed. In looking through the bootstrap code, it seems that those two classes are never defined alone or for the HTML table element, only for the td and th elements. So I can't use my .datagrid class and have to use the bootstrap classes, anyway.