Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Implement Tailwind CSS to Twilio Flex Plugins? #798

Open
Mlfraga opened this issue Feb 21, 2023 · 0 comments
Open

How to Implement Tailwind CSS to Twilio Flex Plugins? #798

Mlfraga opened this issue Feb 21, 2023 · 0 comments

Comments

@Mlfraga
Copy link

Mlfraga commented Feb 21, 2023

Hi,

I would like to know how to implement Tailwind CSS to Twilio Flex Plugins. I have already installed Tailwind CSS using npm and set up the tailwind.config.js file. I have also hosted a global.css file in the Twilio assets and used the loadCSS function from '@twilio/flex-plugin' to load them.

Here is the code snippet that I'm currently using:

import React from "react"
import { FlexPlugin, loadCSS } from "@twilio/flex-plugin"

import { Flex } from "@twilio/flex-ui/src/FlexGlobal"
import Leads from "./components/Leads"

const PLUGIN_NAME = "LeadsPlugin"

export default class LeadsPlugin extends FlexPlugin {
  constructor() {
    super(PLUGIN_NAME)
  }

  async init(flex: typeof Flex, manager: Flex.Manager) {
    loadCSS('https://cornsilk-herring-9773.twil.ioassets/global.css');

    flex.AgentDesktopView.Panel2.Content.remove('container'); // 'container' key is the CRMContainer
    flex.AgentDesktopView.Panel2.Content.add(<Leads key='customContent' />);    
  }
}

However, I'm still facing issues in implementing Tailwind CSS. Can someone help me with the correct way to implement it?

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant