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

CSS not loading in FormViewer #24

Open
minh-tranchi opened this issue Jun 26, 2024 · 4 comments
Open

CSS not loading in FormViewer #24

minh-tranchi opened this issue Jun 26, 2024 · 4 comments

Comments

@minh-tranchi
Copy link

This is my form with the custom container which has been modified to show flexDirection is row
image
But in the FormViewer, It's still show the container in column direction
image

I've check the JSON data for the form and it do have the css property for it, is there any way to fix this?

@optimajet
Copy link
Owner

@minh-tranchi please attach the JSON of the form and the definitions of your custom components needed to run the example.

Here is an example of how the container for the components from the demo is defined, maybe this will help:

import styled from '@emotion/styled'
import {containerStyles, define, node} from '@react-form-builder/core'

const RsContainer = styled.div`
  display: flex;
`
const {flexDirection, gap} = containerStyles

export const rsContainer = define(RsContainer, 'RsContainer')
  .name('Container')
  .kind('container')
  .props({
    children: node.hinted('Component children')
  })
  .css({
    ...containerStyles,
    flexDirection: flexDirection.default('column'),
    gap: gap.default('10px')
  })

@minh-tranchi
Copy link
Author

minh-tranchi commented Jun 27, 2024

Thanks mate, your given sample handle my problem quite well. I forgot to define using containerStyles props

@minh-tranchi
Copy link
Author

minh-tranchi commented Jun 28, 2024

I'm having a problem when using the HTML of the Form Viewer for sending Email
image
image
Knowing that Gmail will remove class in the HTML when sending. Is there any way for me to get the inline Style instead of compiled class so that the form style still show in Gmail
@optimajet

@optimajet
Copy link
Owner

@minh-tranchi

Knowing that Gmail will remove class in the HTML when sending. Is there any way for me to get the inline Style instead of compiled class so that the form style still show in Gmail

Unfortunately not.

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