Get Tailwindcss in Salesforce org

0 votes
I want get Tailwindcss into my Salesforce org, so that I can use those classes for UI requirements in LWC/Aura components, Searched online a lot but couldn't find anything, Help me with the steps?
Apr 5, 2022 in SalesForce by surbhi
• 3,820 points
1,041 views

1 answer to this question.

0 votes

You must to get the tailwind css file(https://unpkg.com/tailwindcss@2.2.19/dist/tailwind.min.css), then you should upload as an static resource to the org.

You can add those styles from LWC using this code:

import resourceName from '@salesforce/resourceUrl/tailwind';
import { loadStyle, loadScript } from 'lightning/platformResourceLoader';

loadStyle(this, resourceName + '/tailwind.min.css')

Just to mention, using in that way:

  • You can't customize Tailwind's default theme
  • You can't use any directives like @apply, @variants, etc.
  • You can't enable additional variants like group-focus
  • You can't install third-party plugins
  • You can't tree-shake unused styles
I hope this helps!
Enroll for the salesforce admin course here to learn more.
answered Apr 6, 2022 by CoolCoder
• 4,420 points

Related Questions In SalesForce

0 votes
1 answer

Json response to be deserialized in Apex salesforce lightning

Because some fields in Apex Salesforce are ...READ MORE

answered Mar 2, 2022 in SalesForce by surbhi
• 3,820 points
3,586 views
0 votes
1 answer

How can i use select * in SOQL query in Salesforce?

SOQL is not the same as SQL. ...READ MORE

answered Mar 3, 2022 in SalesForce by CoolCoder
• 4,420 points
2,451 views
0 votes
1 answer

How to Update RecordTypeId field in Lightning record form in salesforce?

A critical action that messes everything up ...READ MORE

answered Mar 3, 2022 in SalesForce by CoolCoder
• 4,420 points
3,373 views
0 votes
1 answer

Salesforce picklist values not showing up in picklist

For both standard and custom objects, go ...READ MORE

answered Mar 3, 2022 in SalesForce by CoolCoder
• 4,420 points

edited Jun 19, 2023 by Khan Sarfaraz 16,436 views
+2 votes
2 answers

Salesforce Interview questions

Here are some questions very important for ...READ MORE

answered Jan 11, 2019 in Career Counselling by Suresh
• 720 points
3,461 views
0 votes
1 answer

How to connect to salesforce from tableau?

Hi, follow these steps to connect to Salesforce: 1. ...READ MORE

answered Mar 25, 2019 in Tableau by Cherukuri
• 33,030 points
1,070 views
0 votes
1 answer

Power BI - Salesforce

Hi, Follow below steps: 1. Go to Data source. 2. ...READ MORE

answered Mar 25, 2019 in Power BI by Cherukuri
• 33,030 points
787 views
0 votes
2 answers

What is the best training for Salesforce ADM-201 Exam?

Hi @Vardhan, I took Edureka's Salesforce Online Training, ...READ MORE

answered Jun 3, 2021 in Others by Jaya
• 140 points

edited Dec 22, 2021 by Soumya 749 views
0 votes
1 answer

How do i get all values from a global pick list in salesforce using REST Api?

Since API 39.0 it is possible to ...READ MORE

answered Mar 17, 2022 in SalesForce by CoolCoder
• 4,420 points
7,073 views
0 votes
1 answer

Check string value in salesforce test class

Because the field objCase.standard_or_nonstandard_c is set to ...READ MORE

answered Mar 3, 2022 in SalesForce by CoolCoder
• 4,420 points
1,659 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP