Hi @charlie,
I have just been looking at your response to a previous question in Parameters: Set inital value for responsive settings with isVar
I am creating a Headline Component with parameters as an export Component, but am struggling with one aspect of it. Using the example in the link above, I am trying to set an initial font-size for each of the five breakpoints. However, by design, the font sizes are not visible in the parameter settings. the font sizes are set by choosing the heading tag h2, h3, h4, each of which is wired up to use objects as value (as per the Themeco documentation).
Below are my parameter settings. The relevant part comes under the second “param” - tags (please note that I have only added the breakpoints for the h2 section). In dev tools I have inserted {{dc:p:heading.tag.fontSize.desktop}}
for the large screen setting and the appropriate code for each of the smaller screen sizes:
{
"heading" : {
"type" : "group",
"label" : "Heading",
"params" : {
"content" : {
"label" : "Heading",
"type" : "text",
"initial" : "Headline Goes Here",
"placeholder" : "e.g. Your Heading"
},
"tag" : {
"type" : "choose",
"label" : "Tag",
"initial" : "h2",
"options" : [
{
"value" : {
"tag" : "h2",
"fontSize" : {
"type" : "group",
"params" : {
"desktop" : {
"type" : "font-size",
"initial" : "2em"
},
"laptop" : {
"type" : "font-size",
"initial" : "2em"
},
"tablet" : {
"type" : "font-size",
"initial" : "1.5em"
},
"tabletPortrait" : {
"type" : "font-size",
"initial" : "1.2em"
},
"mobile" : {
"type" : "font-size",
"initial" : "1.2em"
}
}
}
},
"label" : "h2"
},
{
"value" : {
"tag" : "h3",
"font-size" : "1.5em"
},
"label" : "h3"
},
{
"value" : {
"tag" : "h4",
"font-size" : "1.2em"
},
"label" : "h4"
}
]
},
"align" : {
"label" : "Align",
"type" : "choose",
"initial" : "center",
"offValue" : "none",
"isVar" : true,
"options" : [
{ "value" : "left", "icon" : "ui:text-align-left" },
{ "value" : "center", "icon" : "ui:text-align-center" },
{ "value" : "right", "icon" : "ui:text-align-right" },
{ "value" : "justify", "icon" : "ui:text-align-justify" }
]
},
"color" : {
"label" : "Text Colour",
"type" : "color",
"initial" : "#000000"
},
"margin" : {
"type" : "group",
"label" : "Margin",
"noPicker" : "true",
"params" : {
"top" : {
"type" : "margin",
"label" : "Top",
"labelBefore" : "css:margin-top",
"initial" : "0px",
"isVar" : true
},
"right" : {
"type" : "margin",
"label" : "Right",
"labelBefore" : "css:margin-right",
"initial" : "0px",
"isVar" : true
},
"bottom" : {
"type" : "margin",
"label" : "Bttm",
"labelBefore" : "css:margin-bottom",
"initial" : "0px",
"isVar" : true
},
"left" : {
"type" : "margin",
"label" : "Left",
"labelBefore" : "css:margin-left",
"initial" : "0px",
"isVar" : true
}
}
}
}
}
}
Is it possible to do what i am trying to do? In a less perfect world I would create three separate headline export components where the font-size can be explicitly changed, but I am trying to find a solution where the heading tag can manage the font-sizing automatically.
Thanks,
Christopher