diff --git a/css/_villages.scss b/css/_villages.scss new file mode 100644 index 000000000..42cf4d82c --- /dev/null +++ b/css/_villages.scss @@ -0,0 +1,82 @@ +/* Villages */ +@use "./_variables.scss" as *; + +.village-table { + display: grid; + padding: 0; + + .village-table-title a { + color: inherit; + } + + /* Display as cards */ + @media (max-width: 600px) { + grid-template-columns: 1fr; + + .village-table-header { + display: none; + } + .village-table-village { + background-color: $highlight-background; + color: $highlight-background-text; + border-radius: 3px; + padding: 10px 15px 10px 15px; + margin-bottom: 10px; + } + + .village-table-title { + color: $highlight-background-text; + margin-top: 0; + } + .village-table-description { + margin: 0; + } + } + + /* Display as table */ + @media (min-width: 600px) { + grid-template-columns: [title-start] auto [title-end desc-start] auto [desc-end links-start] max-content [links-end]; + + background-color: $highlight-background; + color: $highlight-background-text; + border-radius: 3px; + + .village-table-village, .village-table-header { + display: contents; + } + .village-table-header h4 { + font-weight: bold; + } + + .village-table-title, .village-table-description, .village-table-links { + margin: 0; + padding: 10px 15px 5px 15px; + } + .village-table-village .village-table-title { + font-size: inherit; + font-family: inherit; + } + .village-table-village::before { + display: block; + content: ''; + height: 0; + border-top: 1px solid #aaa; + grid-column: title-start / links-end; + } + .village-table-title { + grid-column: title-start / title-end; + color: $highlight-background-text; + } + .village-table-description { + grid-column: desc-start / desc-end; + color: $highlight-background-text; + } + .village-table-links { + grid-column: links-start / links-end; + } + + &:not(.village-table-located) { + grid-template-columns: [title-start] auto [title-end desc-start] auto [desc-end links-start] 0 [links-end]; + } + } +} diff --git a/css/main.scss b/css/main.scss index 9e0172175..b7ae6b4b3 100644 --- a/css/main.scss +++ b/css/main.scss @@ -19,6 +19,7 @@ @use "./_tickets.scss"; @use "./_responsive_table.scss"; @use "./_sponsorship.scss"; +@use "./_villages.scss"; @use "./volunteer_schedule.scss"; @font-face { diff --git a/templates/villages/villages.html b/templates/villages/villages.html index b8ec8c881..640eb9a54 100644 --- a/templates/villages/villages.html +++ b/templates/villages/villages.html @@ -12,33 +12,27 @@
Name | -Description | - {% if any_village_located %}{% endif %} - | |
---|---|---|---|
{{village.name}} | - {% else %} -{{village.name}} | - {% endif %} -{{village.description}} | - {% if any_village_located %} -- {% if village.map_link %} - 📍 Map - {% endif %} - | - {% endif %} - -