CSS String Variables

Post here questions and problems related to editing and publishing DITA content.
jmorales
Posts: 93
Joined: Tue Oct 30, 2018 9:47 pm

CSS String Variables

Post by jmorales »

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: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: CSS String Variables

Post by Dan »

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: 93
Joined: Tue Oct 30, 2018 9:47 pm

Re: CSS String Variables

Post by jmorales »

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