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

Using jsonforms/react with scss #2282

Closed
Marco-Ca opened this issue Feb 13, 2024 · 1 comment
Closed

Using jsonforms/react with scss #2282

Marco-Ca opened this issue Feb 13, 2024 · 1 comment

Comments

@Marco-Ca
Copy link

Marco-Ca commented Feb 13, 2024

Is your feature request related to a problem? Please describe.

Hello, firstly, I would like to know if jsonforms works with css preprocessor (couldnt find it in docs)? We use scss in our project and it would be nice to have the support for it. Additionally, it would also help to add the feature to add class/classNames to custom elements (see suggested solution)

Describe the solution you'd like

{
  "type": "HorizontalLayout",
    "elements": [
      {
        "type": "Control",
        "scope": "#/properties/due_date",
        "options":  {
          "format": "date",
          "classNames: ['customClass', 'anotherCustomClass']
        }
      }

Describe alternatives you've considered

Tried using custom renderers but it does not work in our use case as we generate uischema and schema on the constantly and dynamically

Framework

Core, React

RendererSet

Material, Other (please specify in the Additional context field)

Additional context

No response

@sdirix
Copy link
Member

sdirix commented Feb 14, 2024

Hi!

Adding additional classes via UI Schema is currently only supported out of the box in the Vue Vanilla renderers. In the React Vanilla renderers the form-wide classes can be configured, but not not for specific controls.

Tried using custom renderers but it does not work in our use case as we generate uischema and schema on the constantly and dynamically

Custom renderers and their testers are fully generic, so they can be used to solve any use case. At minimum, you can add the custom class support via custom renderers, leveraging the approach you would like to see.

Please describe your use cases in more detail if you want more detailed advice.

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

2 participants