Loading...

Tailwind CSS for your PCF control

Tailwind CSS for your PCF control

What is TailwindCSS?

Tailwind CSS is a utility-first CSS framework packed with classes like that can be composed to build any design, directly in your markup.

Check their website here

image.png

image.png

image.png

How it works?

Tailwind CSS works by scanning all of your HTML files, JavaScript components, and any other templates for class names, generating the corresponding styles and then writing them to a static CSS file.

It's fast, flexible, and reliable with zero-runtime.

Check the docs here

Why?

Tiny size files, ship only used css

Light weight attractive components

Build fully responsive components easy!

VSCode intellisense

Fully customizable

Available plugins available

You work on your component, css file gets updated automatically!

Lots of ready components from Tailwind or from developer communities

Installation

Follow the installation docs here but in step number 5 do the below,

in the manifest file in your PCF control, load the generated css file (the one you generated from step 4)

<resources>
      <code path="index.ts" order="1"/>
      <css path="generated/style.css" order="1" />
    </resources>

Usage

After you install the Tailwind extension on VS code, just write css in your tsx, or jsx and the terminal session running from step 4 will take care of it.

<p className="mt-2 text-sm text-gray-700">

these will be translated to the below automatically!

.mt-2 {
    margin-top: 0.5rem/* 8px */;
}
.text-sm {
    font-size: 0.875rem/* 14px */;
    line-height: 1.25rem/* 20px */;
}
.text-gray-700 {
    --tw-text-opacity: 1;
    color: rgb(55 65 81 / var(--tw-text-opacity));
}

powerapps-modals with Tailwind CSS

💻 powerapps-modals built with TailwindCSS, it was easy to build attractive dynamic modals.

image.png

🧑💻 Check source code here

Useful links

📃 Docs

🖲 Components

🧭 Tailwindcomponents.com

Happy PCFing!

Published on:

Learn more
Vite apps
Vite apps

Vite apps

Share post:

Related posts

Fast configuring security roles for your Dataverse project

If you're working on a Dataverse project specially without Dynamics 365 apps, you can make it easy to configure security roles for the project...

3 years ago

Display Omnichannel chat widget in the footer of your portal

The combination of PowerPortals, Dynamics 365 Omnichannel and Power Virtual Agents increases the level of customer engagement for customers, i...

3 years ago

Process & visualize Dynamics 365 marketing data

When Marketing emails and journeys are active, you start seeing the analytics in Dynamics 365 for Marketing, like the below The analytics are...

3 years ago

State management simplified with zustand

zustand is a small, fast and scalable state management package that you can use with your react applications, it can be used as your data stor...

3 years ago

What is powerapps-modals?

Overview powerapps-modals gives you the tool to build attractive modals in Model-driven apps fast & easy. You just need to configure the m...

3 years ago

How to use powerapps-modals

In this blog, I'm writing some examples that power-apps modals can be used. 🧑💻 Source code Main function to call modals here function displa...

3 years ago

Combo Box Control

Intro ComboBox control is an auto-complete dropdown where users are able to search and navigate between options. For installation follow the ...

3 years ago

Radio Group

Intro Radio group control is a control that represents single select options in different radio representations For installation follow the l...

3 years ago

Advanced Text Area

Intro Advanced Text Area is a control that speeds up creating records. Why advanced? The control can be configured to let users attach files ...

3 years ago

Improve site speed in PowerPages

What is CDN? In short, Content Delivery Network (CDN) caches your public assets of your site in distributed servers, so if you have a website ...

3 years ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy