Further feature implementation for flock.town

This commit is contained in:
2025-02-19 22:03:17 +01:00
parent dfa740456f
commit 7d24e1d414
20 changed files with 424 additions and 143 deletions

View File

@@ -5,7 +5,7 @@ This **Ansible role** provides a **global theming solution** for Nginx-based web
## 🚀 Features
**Automatic CSS Deployment** Injects `global.css` into all Nginx-served applications.
**Dynamic Theming** Uses `global_theming.css.colors` from Ansible variables for **full customization**.
**Dynamic Theming** Uses `design.css.colors` from Ansible variables for **full customization**.
**Bootstrap Override Support** Ensures Bootstrap-based apps use the **unified global styles**.
**Versioning System** Prevents caching issues with automatic **timestamp-based versioning**.
**Dark Mode Support** Automatically adapts to user preferences.

View File

@@ -1,14 +1,5 @@
# Load this role via nginx-modifier-all for consistency
- name: Ensure {{nginx.directories.global}} directory exists
file:
path: "{{nginx.directories.global}}"
state: directory
owner: "{{nginx.user}}"
group: "{{nginx.user}}"
mode: '0755'
when: run_once_nginx_global_css is not defined
- name: Deploy global.css from template
template:
src: global.css.j2

View File

@@ -11,15 +11,15 @@ HINT:
:root {
/** Derived Colors from the Base Color **/
{% for i in range(1, 100) %}
--color-{{ "%02d"|format(i) }}: {{ global_theming.css.colors.base | adjust_color(target_lightness=(i / 100),saturation_change=global_theming.css.filters.saturation_change,hue_shift=global_theming.css.filters.hue_shift) }};
--color-rgb-{{ "%02d"|format(i) }}: {{ global_theming.css.colors.base | adjust_color_rgb(target_lightness=(i / 100),saturation_change=global_theming.css.filters.saturation_change,hue_shift=global_theming.css.filters.hue_shift) }};
--color-{{ "%02d"|format(i) }}: {{ design.css.colors.base | adjust_color(target_lightness=(i / 100),saturation_change=design.css.filters.saturation_change,hue_shift=design.css.filters.hue_shift) }};
--color-rgb-{{ "%02d"|format(i) }}: {{ design.css.colors.base | adjust_color_rgb(target_lightness=(i / 100),saturation_change=design.css.filters.saturation_change,hue_shift=design.css.filters.hue_shift) }};
{% endfor %}
/** Special Action Colors **/
--success-color: {{ global_theming.css.colors.success }};
--warning-color: {{ global_theming.css.colors.warning }};
--error-color: {{ global_theming.css.colors.error }};
--info-color: {{ global_theming.css.colors.info }};
--success-color: {{ design.css.colors.success }};
--warning-color: {{ design.css.colors.warning }};
--error-color: {{ design.css.colors.error }};
--info-color: {{ design.css.colors.info }};
}
@@ -27,15 +27,15 @@ HINT:
:root {
/** Dark Mode Derived Colors from the Base Color **/
{% for i in range(1, 100) %}
--color-{{ "%02d"|format(i) }}: {{ global_theming.css.colors.base | adjust_color(target_lightness=(1 - (i / 100)),saturation_change=global_theming.css.filters.saturation_change,hue_shift=global_theming.css.filters.hue_shift) }};
--color-rgb-{{ "%02d"|format(i) }}: {{ global_theming.css.colors.base | adjust_color_rgb(target_lightness=(1 - (i / 100)),saturation_change=global_theming.css.filters.saturation_change,hue_shift=global_theming.css.filters.hue_shift) }};
--color-{{ "%02d"|format(i) }}: {{ design.css.colors.base | adjust_color(target_lightness=(1 - (i / 100)),saturation_change=design.css.filters.saturation_change,hue_shift=design.css.filters.hue_shift) }};
--color-rgb-{{ "%02d"|format(i) }}: {{ design.css.colors.base | adjust_color_rgb(target_lightness=(1 - (i / 100)),saturation_change=design.css.filters.saturation_change,hue_shift=design.css.filters.hue_shift) }};
{% endfor %}
/** Special Action Colors **/
--success-color: {{ global_theming.css.colors.success | adjust_color(target_lightness=(1 - 0.2)) }};
--warning-color: {{ global_theming.css.colors.warning | adjust_color(target_lightness=(1 - 0.3)) }};
--error-color: {{ global_theming.css.colors.error | adjust_color(target_lightness=(1 - 0.3)) }};
--info-color: {{ global_theming.css.colors.info | adjust_color(target_lightness=(1 - 0.2)) }};
--success-color: {{ design.css.colors.success | adjust_color(target_lightness=(1 - 0.2)) }};
--warning-color: {{ design.css.colors.warning | adjust_color(target_lightness=(1 - 0.3)) }};
--error-color: {{ design.css.colors.error | adjust_color(target_lightness=(1 - 0.3)) }};
--info-color: {{ design.css.colors.info | adjust_color(target_lightness=(1 - 0.2)) }};
}
}

View File

@@ -1,3 +1,3 @@
location = /global.css {
root {{nginx.directories.global}};
root {{nginx.directories.data.global}};
}

View File

@@ -1 +1 @@
global_css_destination: "{{nginx.directories.global}}global.css"
global_css_destination: "{{nginx.directories.data.global}}global.css"