Technologies XML / XSL-FO / Référence / Extensions XSL d’Antenna House Formatter / Propriétés / box-shadow

(Extrait 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

Catégorie Bordures >> Ombre de boîte

Définit l’ombre de la boîte. [CSS3-Background] Ombres portées : la propriété ‘box-shadow’

Valeur :

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

Valeur initiale :

none

S’applique à :

tous les éléments pouvant avoir des bordures

Hérité :

no

Pourcentages :

N/A

Les valeurs ont les significations suivantes.

none

Aucune ombre n’est affichée.

inset

Une ombre intérieure est affichée. Ce réglage est ignoré avec AH Formatter V6.3 Liteen vis-à-vis. V6.3[no-LT]

Les valeurs <length> et <color> ont les significations suivantes :

  • La première <length> définit le décalage horizontal de l’ombre. L’ombre se situe à droite de la zone avec une valeur positive, et à gauche de la zone avec une valeur négative.

  • La deuxième <length> définit le décalage vertical de l’ombre. L’ombre se situe en bas de la zone avec une valeur positive, et en haut de la zone avec une valeur négative.

  • La troisième <length> doit être positive ou nulle et définit le rayon de flou. Avec 0, aucun flou n’est appliqué. Ce réglage est ignoré avec AH Formatter V6.3 Lite. V6.3no-LT

  • La quatrième <length> définit l’étalement de l’ombre. Une valeur positive agrandit la région ; une valeur négative la réduit. V6.3no-LT

  • La couleur de l’ombre peut être définie par <color>.

Cette combinaison peut être spécifiée plusieurs fois pour superposer plusieurs ombres. V6.3

ATTENTION :

L’unité minimale de <length> est 1/96in=0.265mm. La valeur est arrondie à un multiple de cette unité.

ATTENTION :

Le flou est sans effet sur les sorties ne prenant pas en charge la transparence, telles que PDF/X.

Exemple 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>

Télécharger les exemples

Résultat :

haut de page