CSS String Variables
Posted: Sat Oct 19, 2019 7:04 am
Hi,
I'm trying to use a string variable so as not to repeat the same text in multiple places in the CSS. The code looks like this:
:root{
--footer-text: 'Confidential - Proprietary Information - For Use By Authorized Company Clients Only. Do Not Distribute.';
}
@page {
@bottom-center {
content: var(--footer-text);
}
}
Unfortunately, the bottom center text comes out blank when I transform my document to PDF. Yet it works OK if I enter the text directly, as
@bottom-center {
content: "Confidential - Proprietary Information - For Use By Authorized Company Clients Only. Do Not Distribute.";
}
Have I got the syntax wrong, or am I attempting something that is not supported? Thanks!
I'm trying to use a string variable so as not to repeat the same text in multiple places in the CSS. The code looks like this:
:root{
--footer-text: 'Confidential - Proprietary Information - For Use By Authorized Company Clients Only. Do Not Distribute.';
}
@page {
@bottom-center {
content: var(--footer-text);
}
}
Unfortunately, the bottom center text comes out blank when I transform my document to PDF. Yet it works OK if I enter the text directly, as
@bottom-center {
content: "Confidential - Proprietary Information - For Use By Authorized Company Clients Only. Do Not Distribute.";
}
Have I got the syntax wrong, or am I attempting something that is not supported? Thanks!