function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JasonGJasonG 

Why add a bunch of slds classes to one element instead of adding one custom ccs class?

 Why add a bunch of slds classes for a few features instead of make a custom class with the features I want.  Is there a reason for adding
<div class="slds-box slds-p-around_small slds-m-around_small">
  <!-- Stuff in Container -->
</div>
to a container div instead of making a custom class
<div class="container">
   <!-- Stuff in Container -->
</div>
and adding the css features I specifically want?  I made two similary looking forms one with slds only and one with custom classes and it seems easier to see what is going on to inspect one class and check the css styles instead of inspecting multiple slds classes to find the slds styles. What is best practice?
Zachary WaltonZachary Walton
The benefit of using slds classes would be that they will continue to be supported and change with how Salesforce changes. This means that if Salesforce decides to change how something looks then your components using slds will automatically change to look that way. If you use custom css a change like that might make your component look different. So really its probably up to personal preference.