Skip to content

CSS Properties

Ogre supports a subset of CSS designed for image generation. All properties can be used as inline styles.

PropertyValues
displayflex, none, block, contents
positionstatic, relative, absolute
top, right, bottom, leftLength values
width, heightLength, percentage, auto
min-width, min-heightLength values
max-width, max-heightLength values
aspect-ratioNumber (e.g. 16/9)
overflowvisible, hidden
box-sizingcontent-box, border-box
PropertyValues
flex-directionrow, row-reverse, column, column-reverse
flex-wrapnowrap, wrap, wrap-reverse
flex-growNumber
flex-shrinkNumber
flex-basisLength, percentage, auto
align-itemsflex-start, flex-end, center, stretch, baseline
align-selfauto, flex-start, flex-end, center, stretch, baseline
align-contentflex-start, flex-end, center, stretch, space-between, space-around
justify-contentflex-start, flex-end, center, space-between, space-around, space-evenly
gap, row-gap, column-gapLength values

[!NOTE] <div> defaults to display: flex, matching Satori behavior (not browser behavior).

PropertyValues
marginLength (all sides, shorthand)
paddingLength (all sides, shorthand)
border-widthLength (all sides, shorthand)
border-stylesolid, dashed, dotted
border-colorColor value
border-radiusLength (all corners, shorthand)
PropertyValues
font-familyFont name
font-sizeLength
font-weight100-900, normal, bold
font-stylenormal, italic
colorColor value
line-heightNumber or length
letter-spacingLength
text-alignleft, right, center, justify, start, end
text-transformnone, uppercase, lowercase, capitalize
text-decoration-linenone, underline, overline, line-through
text-decoration-colorColor value
text-decoration-styleStyle value
text-shadowShadow value
white-spacenormal, nowrap, pre, pre-wrap, pre-line
word-breaknormal, break-all, break-word, keep-all
text-overflowellipsis
-webkit-line-clampNumber
PropertyValues
background-colorColor value
background-imagelinear-gradient(), radial-gradient(), url()
background-sizeLength, percentage, cover, contain
background-positionPosition value
background-repeatRepeat value
PropertyValues
opacity0-1
box-shadowShadow value
transformTransform functions
transform-originPosition value
object-fitfill, contain, cover, scale-down, none
object-positionPosition value
filterblur(), grayscale(), brightness()
clip-pathClip path value

These shorthand properties expand to their individual components:

margin, padding, border, border-radius, flex, gap, background, font, text-decoration, overflow, border-top, border-right, border-bottom, border-left, border-width, border-style, border-color

Ogre accepts:

  • Named colors: white, black, red, etc.
  • Hex: #ff0000, #f00
  • RGB: rgb(255, 0, 0)
  • RGBA: rgba(255, 0, 0, 0.5)
  • HSL: hsl(0, 100%, 50%)
  • Pixels: 16px
  • Percentages: 50%
  • Em: 1.5em
  • Rem: 1rem
  • Viewport: 100vw, 100vh