cssangularprimengprimeflex

primeng primeflex add a reset css


In all the UI I have used up to now (bootstrap and material) a css reset was always included now for a new project the choice was on primeng with primeflex which has no reset as far as I could see. what is the best practice to include a default css reset file such as bootstrap or use the available classes? For instance

with a reset file I can use

h1 class="mb-3"

without

h1 class="mt-0 mb-3"

I don't really know why a reset file is not by default ^^ It's the first time I'm using primeng so be patience :)


Solution

  • Please note that mb-3 is a PrimeFlex class. It doesn't have anything to do with your component library (PrimeNG). Why no resetting is done by PrimeFlex could only be answered by the creator of that library. It's not documented. My guess would be to keep it lean and make resetting a choice to be made by the user of PrimeFlex.

    Apart from the reseting issue, I would not use classes to style margins on a heading one. Instead create a CSS file with the margins you want to use on a h1. This allows you to simply use

    <h1>...</h1>
    

    on each page instead of having to do

    <h1 class="mb-3">...</h1>
    

    And, if you ever want to change the margin, you can simply modify it in your style sheet.