Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions content/_includes/site/ccs.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% import 'forms.macros.njk' as forms %}
{% import 'toggle.macros.njk' as toggle %}

<details data-ccs="menu" class="has-dropdown" hidden>
<summary data-btn="menu xsmall summary">
Expand All @@ -9,19 +10,23 @@
{% call forms.fieldset(
legend='Color Mode',
name='ccs-modes',
attrs={'data-radio': 'group'}
attrs={'data-group': 'buttons'}
) %}
{% for mode in ['light', 'dark', 'auto'] %}
{{ forms.radio(
label=mode,

<button {{ toggle.btn(
id=[mode, 'mode'] | join('-'),
group='ccs-modes',
attrs={'data-ccs-colors': true if (mode == 'auto') else mode},
input_attrs={
'data-ccs-input': [mode, 'mode'] | join('-'),
'checked': true if (mode == 'auto') else false
attrs={
'data-ccs-colors': true if (mode == 'auto') else mode,
'data-ccs-input': id,
'aria-pressed': true if (mode == 'auto') else false,
'data-toggle-synced': 'true' if synced else 'false'
}
) }}
>
{{ mode }}
</button>
Comment on lines +13 to +29
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgerigmeyer This doesn't really work and I'd love some help on getting this functional before I style it as the markup may change based on how far off I am on this :)

The goal was to replace the radio buttons with actual buttons (for reasons linked in the Trello card (https://lea.verou.me/2022/07/button-group/
https://tink.uk/perceived-affordances-and-the-functionality-mismatch/)

And then style them a bit differently.

I know I hijacked the toggle macro, but I am pretty sure we weren't using that (yet?) and I wanted a place to start.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than updating this in OddSite, I think we should first adjust CCS to allow using buttons instead of just radio inputs.

{% endfor %}
{% endcall %}

Expand Down
4 changes: 3 additions & 1 deletion content/_includes/toggle.macros.njk
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ params:
'aria-controls': id,
'aria-pressed': 'true' if expanded else 'false',
'role': none if button else 'button',
'data-toggle-synced': 'true' if synced else 'false'
'data-toggle-synced': 'true' if synced else 'false',
'data-ccs-colors': true if (mode == 'auto') else mode,
'data-ccs-input': id
} -%}
{{ utility.show_attrs(attrs) }}
{%- endmacro %}
Expand Down
2 changes: 1 addition & 1 deletion src/mentions/webmentions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lastFetched": "2022-09-30T18:18:39.100Z",
"lastFetched": "2022-10-04T17:20:21.483Z",
"children": [
{
"type": "entry",
Expand Down