Search code examples
csswebpackag-gridpowerapps

AG Grid PCF Control - CSS without css loader


Trying to use AG Grid inside of a PCF control, however - PCF controls do not support CSS loaders. Is there any options for CSS without CSS loaders? Thanks.

Reference - https://powerusers.microsoft.com/t5/Power-Apps-Pro-Dev-ISV/Custom-css-file-to-include-in-react-Component-PCF/td-p/563873

"‎06-22-2020 11:38 AM Ah I see - the only supported way of including CSS in PCF right now is by including the css or by using inline styles - the normal webpack css loader would add the css to a style tag on the page which isn't supported by PCF."


Solution

  • Add a reference to your css from your ControlManifest.Input.xml under the resources section. Add a css element there.

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