T
T
tralvor2016-03-18 16:44:43
css
tralvor, 2016-03-18 16:44:43

How to store css in database?

I want to create a website builder for myself.
Interested in a ready-made solution for validating and saving CSS property values ​​in the database, as well as the subsequent generation of CSS styles from the received data.
At the moment I work only on the client - ReactJS. I fill out the form to add a div block, it turns out something like

{
  id: 2, 	
  type: 'div',
  tagclass: '',
  innertext: textexttext,
  css : {
  	on_hover : {
      	border: {
        	size: 2,
        	type: 'solid',
        	color_html: '#333',
      },
  	}
  	width: {
  		size: 8,
  		size_type: 'col'
  	},
  	border: {
      	size: 1,
      	type: 'solid',
      	color_html: '#cdcdcd',
      },
    padding : [25, 25, 25, 25],
    margin : [25, 5, 25, 15]
  } 
}

Further, from this I write functions for generating CSS styles and HTML tags.
I feel like I'm reinventing the wheel. We need to find the right approach to save CSS properties for future work
Found CSSData - almost what is required. Are there any other options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Euaqa, 2016-03-18
@Euaqa

saving CSS property values ​​to the database
Maybe it's better to save Css in a separate textbox, and then just write the path to them?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question