feat(images): diversifie les tailles d image incrustees au texte
Parent
5fa06df7f6
révision
02362ac198
|
@ -7,6 +7,11 @@
|
|||
max-width: 33%;
|
||||
height: auto;
|
||||
margin-right: 2rem;
|
||||
@each $width in 33, 50, 66 {
|
||||
&.w-#{$width} {
|
||||
max-width: percentage($width / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.richtext-image.right {
|
||||
|
@ -14,6 +19,11 @@
|
|||
max-width: 33%;
|
||||
height: auto;
|
||||
margin-left: 2rem;
|
||||
@each $width in 33, 50, 66 {
|
||||
&.w-#{$width} {
|
||||
max-width: percentage($width / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.richtext-image.full-width {
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# image_formats.py
|
||||
from wagtail.images.formats import (
|
||||
Format,
|
||||
register_image_format,
|
||||
unregister_image_format,
|
||||
)
|
||||
|
||||
unregister_image_format('left')
|
||||
unregister_image_format('right')
|
||||
|
||||
for _sens, sens in [('left', 'gauche'), ('right', 'droite')]:
|
||||
for _width, width in [('33', '1/3'), ('50', '1/2'), ('66', '2/3')]:
|
||||
register_image_format(
|
||||
Format(
|
||||
'{}-{}'.format(_sens, _width) if _width != '33' else _sens,
|
||||
'alignée à {}, largeur {}'.format(sens, width),
|
||||
'richtext-image {} w-{}'.format(_sens, _width),
|
||||
'width-{}'.format(1500 * int(_width) // 100),
|
||||
)
|
||||
)
|
Chargement…
Référencer dans un nouveau ticket