# Unable to import CSS into bpmn property panel

**URL:** <https://forum.bpmn.io/t/unable-to-import-css-into-bpmn-property-panel/11111>\
**Category:** Developers\
**Created:** [May 30, 2024, 8:56pm UTC](https://forum.bpmn.io/t/unable-to-import-css-into-bpmn-property-panel/11111 "2024-05-30T20:56:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navein\_Kumar](https://forum.bpmn.io/user_avatar/forum.bpmn.io/navein_kumar/32/5416_2.png) [@Navein\_Kumar](https://forum.bpmn.io/u/Navein_Kumar)\
**Post date:** [May 30, 2024, 8:56pm UTC](https://forum.bpmn.io/t/unable-to-import-css-into-bpmn-property-panel/11111/1 "2024-05-30T20:56:29Z")

</div>

I am trying to add custom css to the bpmn-js-properties-panel project but I get the error [!] RollupError: Expression expected (Note that you need plugins to import files that are not JavaScript).

What is the conventional way to import and use css in bpmn-js-propertiespanel ?

---

<div class="post-metadata">

**Author:** ![Navein\_Kumar](https://forum.bpmn.io/user_avatar/forum.bpmn.io/navein_kumar/32/5416_2.png) [@Navein\_Kumar](https://forum.bpmn.io/u/Navein_Kumar)\
**Post date:** [May 30, 2024, 10:08pm UTC](https://forum.bpmn.io/t/unable-to-import-css-into-bpmn-property-panel/11111/2 "2024-05-30T22:08:54Z")

</div>

I saw the remedies and tried out rollback config but still the css is not getting applied, if i have the style in place then it works but when i import as external css file then it fails, what can be done here.

Importing as external file :

```auto

import { h } from 'preact';
import './modal.css';

const Dialog = ({ isOpen, onClose }) => {
  if (!isOpen) return null;

  return (
    <div class="dialog-overlay" onClick={onClose}>
      <div class="dialog-content" onClick={(e) => e.stopPropagation()}>
        <h2>Dialog Title</h2>
        <p>This is a dialog box. You can put any content here.</p>
        <button onClick={onClose}>Close</button>
      </div>
    </div>
  );
};

export default Dialog;

```

Defining style within same file :

````auto
import { h } from 'preact';

const Dialog = ({ isOpen, onClose }) => {
  if (!isOpen) return null;

  const dialogOverlayStyle = {
    position: 'fixed',
    top: '0',
    left: '0',
    right: '0',
    bottom: '0',
    background: 'rgba(0, 0, 0, 0.5)',
    display: 'flex',
    justifyContent: 'center',
    alignItems: 'center',
    animation: 'fadeIn 0.3s ease',
  };

  const dialogContentStyle = {
    background: 'white',
    padding: '20px',
    borderRadius: '4px',
    boxShadow: '0 2px 10px rgba(0, 0, 0, 0.1)',
    animation: 'scaleIn 0.3s ease',
  };

  const keyframes = `
    @keyframes fadeIn {
      from {
        opacity: 0;
      }
      to {
        opacity: 1;
      }
    }

    @keyframes scaleIn {
      from {
        transform: scale(0.7);
      }
      to {
        transform: scale(1);
      }
    }
  `;

  return (
    <div>
      <style>{keyframes}</style>
      <div style={dialogOverlayStyle} onClick={onClose}>
        <div style={dialogContentStyle} onClick={(e) => e.stopPropagation()}>
          <h2>Dialog Title</h2>
          <p>This is a dialog box. You can put any content here.</p>
          <button onClick={onClose}>Close</button>
        </div>
      </div>
    </div>
  );
};

export default Dialog;```
````

---

<div class="post-metadata">

**Author:** ![Martin](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@Martin](https://forum.bpmn.io/u/Martin)\
**Post date:** [May 31, 2024, 7:23am UTC](https://forum.bpmn.io/t/unable-to-import-css-into-bpmn-property-panel/11111/3 "2024-05-31T07:23:47Z")

</div>

Why do you need to import css in the properties-panel project? Could you add the same CSS to the application that integrates the modeler?

---

<div class="post-metadata">

**Author:** ![Navein\_Kumar](https://forum.bpmn.io/user_avatar/forum.bpmn.io/navein_kumar/32/5416_2.png) [@Navein\_Kumar](https://forum.bpmn.io/u/Navein_Kumar)\
**Post date:** [May 31, 2024, 3:17pm UTC](https://forum.bpmn.io/t/unable-to-import-css-into-bpmn-property-panel/11111/4 "2024-05-31T15:17:01Z")

</div>

I am trying to use components from preact-material-components package which require external css imports.

Ex : [Dialog](https://material.preactjs.com/component/dialog/)

But as mentioned i am not able to achieve the required CSS as i import, where specifucally are u asking me to add the CSS definitions, do we have any specific css file within bpms-js-properties-panel project itself ?

---

<div class="post-metadata">

**Author:** ![Martin](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@Martin](https://forum.bpmn.io/u/Martin)\
**Post date:** [June 3, 2024, 7:19am UTC](https://forum.bpmn.io/t/unable-to-import-css-into-bpmn-property-panel/11111/5 "2024-06-03T07:19:00Z")

</div>

Do I assume correctly that this is about a Camunda Modeler Plugin? As those do not have a `index.html` file you have 2 options for importing CSS:

1. You JavaScript creates the `style` elements dynamically
2. Bundle everything in one css file and add it in the entry point

You can read more about it here: [Plugins | Camunda 8 Docs](https://docs.camunda.io/docs/components/modeler/desktop-modeler/plugins/#getting-started-with-development)

---

<div class="post-metadata">

**Author:** ![Navein\_Kumar](https://forum.bpmn.io/user_avatar/forum.bpmn.io/navein_kumar/32/5416_2.png) [@Navein\_Kumar](https://forum.bpmn.io/u/Navein_Kumar)\
**Post date:** [June 5, 2024, 2:24pm UTC](https://forum.bpmn.io/t/unable-to-import-css-into-bpmn-property-panel/11111/6 "2024-06-05T14:24:24Z")

</div>

okay will try that out also is there a way to automate tasks like opening a dmn file in new tab, this is completely out of this thread, question posted here : [Open new DNM table on button click plugin](https://forum.bpmn.io/t/open-new-dnm-table-on-button-click-plugin/11133)

Could u help me out with this?

---

<div class="post-metadata">

**Author:** ![barmac](https://forum.bpmn.io/user_avatar/forum.bpmn.io/barmac/32/974_2.png) [@barmac](https://forum.bpmn.io/u/barmac)\
**Post date:** [July 9, 2025, 10:10am UTC](https://forum.bpmn.io/t/unable-to-import-css-into-bpmn-property-panel/11111/7 "2025-07-09T10:10:39Z")

</div>

Closed on July 9, 2025, 10:10am UTC

Closing old topics.
