LAMaglan / PokeFightSimulator

A (simple) fight simulator between any two Pokemon using FastAPI with Jinja frontend
0 stars 0 forks source link

integrate CSS from base.html to types.html #76

Closed LAMaglan closed 1 month ago

LAMaglan commented 1 month ago

Address https://github.com/LAMaglan/PokeFightSimulator/issues/72

Some details.

{% extends "base.html" %}

This has been used before, which tells the template engine that this template (i.e. types.html) inherits from base.html. A new details is that the child (i.e. types.html) can also override specific blocks in base.html.

The {{ super() }} call (e.g. in types.html) is used within such a block to include the content of the block from the parent template (i.e. base.html) before adding or modifying content. This is useful when you want to extend or add to the content of a block rather than completely replace it. However, if the block from the parent is "empty", then {{ super() }} is superflous, as it is in this case.