Tecnologías XML / XSL-FO / Referencia / Extensiones XSL de Antenna House Formatter / Propiedades / box-shadow

(Extracto de «XSL-FO ― Die Referenz» de Manuel Montero Pineda & Steffen Herkert, 2016, dpunkt.verlag)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Categoría Bordes >> Sombra de caja

Especifica la sombra de la caja. [CSS3-Background] Sombras proyectadas: la propiedad ‘box-shadow’

Valor:

none | inset? && [ <length>{2,4} && <color>? ]#

Valor inicial:

none

Se aplica a:

todos los elementos que pueden tener bordes

Heredado:

no

Porcentajes:

N/A

Los valores tienen los significados siguientes.

none

No se muestra ninguna sombra.

inset

Se muestra una sombra interior. Este ajuste se ignora en AH Formatter V6.3 Liteenfrentada. V6.3[no-LT]

Los valores <length> y <color> tienen los siguientes significados:

  • La primera <length> define el desplazamiento horizontal de la sombra. La sombra se sitúa a la derecha de la región con un valor positivo, y a la izquierda de la región con un valor negativo.

  • La segunda <length> define el desplazamiento vertical de la sombra. La sombra se sitúa abajo de la región con un valor positivo, y arriba de la región con un valor negativo.

  • La tercera <length> debe ser no negativa y especifica el radio de desenfoque. Con 0, no se aplica desenfoque. Este ajuste se ignora en AH Formatter V6.3 Lite. V6.3no-LT

  • La cuarta <length> define la expansión de la sombra. Un valor positivo amplía la región; uno negativo la reduce. V6.3no-LT

  • El color de la sombra puede especificarse mediante <color>.

Esta combinación puede especificarse varias veces para superponer varias sombras. V6.3

ATENCIÓN:

La unidad mínima de <length> es 1/96in=0.265mm. El valor se redondea a un múltiplo de esa unidad.

ATENCIÓN:

El desenfoque no tiene efecto en salidas que no admiten transparencia, como PDF/X.

Ejemplo XSL-FO:

<fo:root xml:lang="en" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:cpfo="http://www.compart.net/xmlns/cpfo" xmlns:svg="http://www.w3.org/2000/svg" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
<axf:document-info name="document-title" value="Box shadow"/>
<axf:document-info name="author" value="Antenna House, Inc."/>
<fo:layout-master-set>
<fo:simple-page-master page-height="297mm" page-width="210mm" margin-top="10mm" margin-left="20mm" margin-right="20mm" margin-bottom="10mm" master-name="PageMaster1">
<fo:region-after extent="7mm"/>
<fo:region-body margin-top="0mm" margin-left="0mm" margin-right="0mm" margin-bottom="10mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="PageMaster1">
<fo:static-content flow-name="xsl-region-after">
<fo:block font-size="0.8em" text-align="right" color="green">
<fo:basic-link external-destination="http://www.antennahouse.com/">
Antenna House, Inc.
</fo:basic-link>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" font-family="serif" font-size="1em" line-height="1.4" axf:hyphenate-hyphenated-word="false" hyphenate="true">
<fo:block span="all" font-family="sans-serif" font-size="2em" font-weight="bold" line-height="2" space-before="1em" space-after="1em" space-before.conditionality="retain" space-after.conditionality="retain" background-color="#EEEEEE">
<fo:block start-indent="1em" end-indent="1em">
Box shadow 
</fo:block>
</fo:block>
<fo:block span="all" space-before="1em" space-after="1em" space-after.conditionality="retain" text-indent="0em" border="1pt solid #9999FF" start-indent="0.5em" end-indent="0.5em" padding="0.5em" text-align="justify">

The box shadow can be specified by axf:box-shadow. Specify axf:box-shadow="10px 10px 10px 10px darkgray", the values are an offset of a horizontal shadow, an offset of a vertical shadow, the blur radius, shadow expantion and the color o f the shadow in order. By adding the inset setting, the inner shadow can be added.
</fo:block>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
axf:box-shadow="10px 10px 0px 0px darkgray"
</fo:block>
<fo:block-container width="100mm" height="12mm" border="solid black 2pt" axf:box-shadow="10px 10px 0px 0px darkgray" space-after="1.5em">
<fo:block/>
</fo:block-container>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
axf:box-shadow="10px 10px 5px 0px darkgray"
</fo:block>
<fo:block-container width="100mm" height="12mm" border="solid black 2pt" axf:box-shadow="10px 10px 5px 0px darkgray" space-after="1.5em">
<fo:block/>
</fo:block-container>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
axf:box-shadow="10px 10px 0px 8px darkgray"
</fo:block>
<fo:block-container width="100mm" height="12mm" border="solid black 2pt" axf:box-shadow="10px 10px 0px 8px darkgray" space-after="2em">
<fo:block/>
</fo:block-container>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
axf:box-shadow="inset 10px 10px 0px 0px darkgray"
</fo:block>
<fo:block-container width="100mm" height="12mm" border="solid black 2pt" axf:box-shadow="inset 10px 10px 0px 0px darkgray" space-after="2em">
<fo:block/>
</fo:block-container>
<fo:block>
When an offset of the shadow is a negative value, the region of the reverse side when a positive value is specified will become the shadow. The combination of values can be specified multiply and shadows can be added several times over.
</fo:block>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
axf:box-shadow="-10px -10px darkgray"
</fo:block>
<fo:block-container width="100mm" height="12mm" border="solid black 2pt" axf:box-shadow="-10px -10px darkgray" space-before="0.5em" space-after="1em" start-indent="1em">
<fo:block/>
</fo:block-container>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
axf:box-shadow="10px 10px dimgray,20px 20px darkgray,30px 30px lightgrey"
</fo:block>
<fo:block-container width="100mm" height="12mm" border="solid black 2pt" axf:box-shadow="10px 10px dimgray,20px 20px darkgray,30px 30px lightgrey">
<fo:block/>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
</fo:root>

Descargar los ejemplos

Resultado:

volver arriba