Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[color-buttons] Replace radios for buttons in theme selector #250

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

stacyk
Copy link
Member

@stacyk stacyk commented Oct 4, 2022

Description

Change Radio buttons to Buttons for color theme selection

Steps to test/reproduce

Toggle the buttons in the light/dark toggle

Show me

WIP

@stacyk
Copy link
Member Author

stacyk commented Oct 4, 2022

Comment on lines +13 to +29
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>
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.

* main: (21 commits)
  Automated dependency upgrades
  Fix shadow-repo workflow concurrency
  Use more explicit filters for hasData/withData.
  review
  review
  Clarify the dates added to bird subtitles
  Add sketches to the intro for acrtive bird detail pages
  Different fix for jestjs/jest#13332
  Use plain checkout action
  Consolidate shadow repo workflows
  update
  Bump actions/checkout from 2 to 3
  Bump cpina/github-action-push-to-another-repository
  Bump peter-evans/create-or-update-comment from 1 to 2
  Bump actions/setup-node from 2 to 3
  adjust readme
  No need to build before test, but must re-install some deps (most are cached)
  upgrade yarn on netlify
  run checks on gh-actions instead of circleci
  Upgrade deps and add script to automate.
  ...
@mirisuzanne
Copy link
Member

@stacyk assigning this old PR to you to determine if it's still relevant, and what the next steps are.

@jgerigmeyer
Copy link
Member

@mirisuzanne I'm pretty sure this comment is still accurate. I don't know if this is a priority or not, but I think we'd need to make changes in Cascading Colors first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants