[SalesForce] How to Style a Lightning Component with Bootstrap Styling

I have a question regarding styling Lightning components. On several occasions lately, I have found myself having to opt for the use of a standard HTML tag styled with bootstrap on which I call core Javascript methods instead of the native Lightning ones. The reason for this is a lot of the native Lightning component styling doesn't look as good as the Bootstrap styling. I am wondering if there is a way to simply style a native Lightning component like <ui:inputSelect> to look like something like this instead of the native style that looks more bland and gray, at least on the desktop app.

I would like to keep the functionality of using cmp.get("v.options") to get the component options and use the functions mentioned here to populate the list dynamically using Lightning patterns, but I'm stuck on the styling aspect, providing that I don't reapply each individual bootstrap CSS property one-by-one.

Best Answer

I will recommend not to style it with bootstrap instead use lightning design system. So, that your component looks consistent with rest of the app. However, if you wan to use bootstrap use

<ltng:require styles="{!$Resource.resourceName}" />

or if you want to use multiple file then

styles="{!join(',', 
    $Resource.myStyles + '/stylesheetOne.css', 
    $Resource.myStyles + '/moreStyles.css')}"

Please refer to following article for more information.

Related Topic