plantain-00 / schema-based-json-editor

A reactjs and vuejs component of schema based json editor.
MIT License
168 stars 38 forks source link

How to control property title size in nested schema? #22

Open DomasM opened 5 years ago

DomasM commented 5 years ago

Version(if relevant): 1.0.0

7.20.3

Environment(if relevant):

Vue 2.6.6

My schema is few levels deep, i.e. object contains object which contains list, which contains object. Title font size is the same for all titles, with default class h3. If I set className property in schema to something and override font-size property via css, font-size changes only for the titles of properties in deepest elements. I would like to to be able to set different font sizes for titles of objects/lists in my schema.

plantain-00 commented 5 years ago

You can set css like .schema-based-json-editor--row h3 { font-size: '12px' }: https://github.com/plantain-00/schema-based-json-editor#improve-current-theme

or add className in schema, then set its css: https://github.com/plantain-00/schema-based-json-editor#non-standard-fields

DomasM commented 5 years ago

Thank you for help, but I am aware of these possibilities. Why I can't make them work: Option no1: all the titles are h3, so I can't make them different. Option no2: this changes font size only for deepest objects properties titles, see image, I expected to change font size for '3. Interaction power measurements' image

plantain-00 commented 5 years ago

What's your style of bigfont? Can you try these?

.bigfont > h3 { font-size: '12px' }
.bigfont > label { font-size: '12px' }
.bigfont h3 { font-size: '12px' }
.bigfont label { font-size: '12px' }

屏幕快照 2019-04-15 22 20 40

DomasM commented 5 years ago

Thank you, it looks like don't really know how to use css. This is the most reasonable result I have. I still need to redefine style for children elements to avoid modifying them, e.g. lines .bigfont h3 { font-size: 22px } and .bigfont2 h3 { color: black } image