formengine icon indicating copy to clipboard operation
formengine copied to clipboard

CSS not loading in FormViewer

Open minh-tranchi opened this issue 1 year ago • 4 comments

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?

minh-tranchi avatar Jun 26 '24 11:06 minh-tranchi

@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')
  })

optimajet avatar Jun 26 '24 13:06 optimajet

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

minh-tranchi avatar Jun 27 '24 03:06 minh-tranchi

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

minh-tranchi avatar Jun 28 '24 04:06 minh-tranchi

@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.

optimajet avatar Aug 22 '24 08:08 optimajet