-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Improvement: New Add Category Flow #1734
Comments
Important Note for Devs: The main thing that we'll have to introduce for this issue is a "stacked menu". I won't be working on this in the near term, so if anyone wants to take it, let me know. Just to keep in mind as we work through the solution here:
I'm not entirely sure what the final solution here looks like, so if you do decide to work on this, be sure to share your thought process as you go to increase the chances we're able to accept a PR! |
The contrast can be automated without too much trouble. WebAIM's ratio details set out pretty straightforward rules for contrast ratio. There's a formula on the scripts of their Contrast Checker page that could be reused here (see contrast.js in sources) |
@JLambertazzo agreed, definitely the right path for validating contrast of manual colors. Adding some solution notes (H/T @robzolkos for the ideas!):
In other words, something along these lines (rough sketch): <%= styled_form_with url: "#" do |f| %>
<details>
<summary>Render collapsed icon/color here</summary>
<div class="absolute">
<div>Color picker goes here (likely need a basic Stimulus controller to sync with the :hex field below)</div>
<%= f.text_field :hex %>
<div class="flex flex-wrap gap-2 justify-center mb-4">
<% Category.icon_codes.each do |icon| %>
<label class="relative">
<%= f.radio_button :lucide_icon, icon, class: "sr-only peer" %>
<div class="p-1 rounded cursor-pointer hover:bg-gray-100 peer-checked:bg-gray-100 border-1 border-transparent peer-checked:border-gray-500">
<%= lucide_icon icon, class: "w-5 h-5" %>
</div>
</label>
<% end %>
</div>
</div>
</details>
<% end %> |
The category modal has been slightly redesigned with a focus on improving the selection process for colors and icons.
Handling low contrast icon colors
Since we’re introducing custom colors, there’s a high chance that users will pick a low-contrast color (e.g., white on a light background), making icons hard to see
Please let me know if you have any questions as you're building this out
Link to the Figma page
The text was updated successfully, but these errors were encountered: