Forum How do I...?

Can i use calc() on a text-indent value?

pablonolla
Hi !

Congratulations for the release of Prince 14. It's getting better all the time :))

I'm finding that i can't set the value of the text-indent property with calc().

Is there any reason for that? Am i doing something wrong?

Here is the html.

Thank you!!


<?xml version="1.0" encoding="utf-8"?>
<html lang="es" xml:lang="es" xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<meta charset="utf-8"/>
<title>testing calc() on text-indent</title>

<style>
:root {
--margin: 24px;
}
.t-p-personaje{
margin-left: var(--margin);
text-indent: calc(var(--margin) * -1);
}
</style>

<!-- <link rel="stylesheet" href="css/07_corte_y_caja.css" type="text/css" /> -->
</head>
<body lang="es">

<section id="toc10" class="t-m-acto" epub:type="chapter">
<h1 class="titulo-escena">Test 1</h1>
<p class="t-p-acotacion">This paragraph is aligned to the left, no margins.</p>
<p class="t-p-personaje"><span class="t-l-personaje">Diablo</span>.– In the other hand, this other two paragraphs have a margin-left and a negative text-indent so that only the first line should align to the left.</p>
<p class="t-p-personaje"><span class="t-l-personaje">Ángel</span>.– No lo puedo creer. Estás mintiendo como siempre. Perjudicando reputaciones y mancillando honores.</p>
</section>

</body>
</html>
mikeday
Your example actually seems to work fine with Prince 14, can you run "prince --version" to check?
pablonolla
Right :)))
I was running a previous version,
Thank you so much!
p