CSS String Variables

jmorales
Posts: 40
Joined: Tue Oct 30, 2018 9:47 pm

CSS String Variables

Post by jmorales » 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!

Dan
Posts: 430
Joined: Mon Feb 03, 2003 10:56 am

Re: CSS String Variables

Post by Dan » Mon Oct 21, 2019 2:50 pm

Hello,
The PDF processor does not support the CSS variables, but it supports LESS (http://lesscss.org/). The extension of the customization file should be .less.
Many regards,
Dan

jmorales
Posts: 40
Joined: Tue Oct 30, 2018 9:47 pm

Re: CSS String Variables

Post by jmorales » Mon Oct 21, 2019 9:19 pm

Thanks, Dan! That looks like it does exactly what we need.

Post Reply