CSS - 'Common Classes' Bad practise or not? -


i used add call 'common classes' css such as:-

.text-color{color:#2da8d9;} .text-white{color:#fff;} .text-lgrey{color:#919d9d !important;} .text-dgrey{color:#879798 !important;} .text-dkgrey{color:#656d6e !important;} .text-dblue{color:#15355c;} .text-lblue{color:#1466b1;} .nopadding{padding: 0 !important; margin: 0 !important;} .margin0{margin:0px !important;} .margint5{margin-top:5px !important;} .margint10{margin-top:10px !important;} .margint20{margin-top:20px !important;} .margint30{margin-top:30px !important;} .margint40{margin-top:40px !important;} .margint50{margin-top:50px !important;} .margint60{margin-top:60px !important;} .margint70{margin-top:70px !important;} .margint80{margin-top:80px !important;} .margint90{margin-top:90px !important;} .margint100{margin-top:100px !important;} .margint120{margin-top:120px !important;} .marginb10{margin-bottom:10px !important;} .marginb20{margin-bottom:20px !important;} .marginb30{margin-bottom:30px !important;}  .marginb40{margin-bottom:40px !important;} .marginb60{margin-bottom:60px !important;} .marginb80{margin-bottom:80px !important;} .marginb90{margin-bottom:90px !important;} .marginb100{margin-bottom:100px !important;} .marginb120{margin-bottom:120px !important;} .pleftnone{padding-left:0 !important;} .padrl20{padding:0 20px;} .padrl50{padding:0 50px;} .marginl20{margin-left:20px;} .padt20{padding-top:20px;} .padt40{padding-top:40px;} .padt80{padding-top:80px;} .padt60{padding-top:60px;} .padb30{padding-bottom:30px;} .padb40{padding-bottom:40px;} .padb60{padding-bottom:60px;} .padb80{padding-bottom:80px;} .padb100{padding-bottom:100px;} .pad5{padding:5px;} .pad10{padding:10px;} .pad20{padding:20px;} .pad30{padding:30px;} .text-center{text-align:center} .text-right{text-align:right} .text-left{text-align:left} .relative-position{position:relative !important} 

and add classes when need use them until told me it's bad practise this?

i find have add position: relative; on quite lot of elements when using absolute positioning on child elements etc , me seems easy add class rather adding in css each time. can understand adds html size adding more classes it's less css because not adding same styles every class?

just want clarification on best practises, apologies in advance if isn't place talk this.

bad. imagine element class text-white margint5 marginb10 padrl20 padb40 text-center relative-position. it's ugly. if need margin 32px? add new class margint32? add classes css properties? border-radius, font-size, font-weight , on.

read bem.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -