dsrkafuu / skyline-overlay

A modern customizable horizon FFXIV miniparse overlay. | 现代定制化 FF14 水平悬浮窗模板。
https://skyline.dsrkafuu.net
Apache License 2.0
79 stars 10 forks source link

Allow themes to have user-customizable color pickers, take two #31

Closed imjoshin closed 2 years ago

imjoshin commented 2 years ago

(Original PR: #27, rebased due to too many changes and just opened a new one)

This PR adds the ability for theme developers to add CSS colors that are customizable by the user.

By adding any amount of "colors" to the theme:

jround: { 
  text: 'Round', 
  colors: { 
    background: {r: 0, g: 0, b: 0, a: 0.3} 
  }
},

User's will be able to modify the colors added in the "General" tab.

Capture Capture

These variables are accessible in theme scss files by using the variable --color-theme-X, where X is the key name in the colors object.

These UI changes are only visible for themes that have custom colors.

See this in action in a new theme! https://github.com/j0sh77/skyline-overlay/pull/1

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging 02736ab958a743fba5f8e5d21ae8a177e9833387 into 9751929d9824aa6b6c343bb3b9a0b156475ccb4d - view on LGTM.com

new alerts:

imjoshin commented 2 years ago

Hey @dsrkafuu, I got #27 all rebased and opened it here. If you have any concerns, let me know!

I opened a PR in my fork for a new theme that relies on this functionality more and I'll re-open it here once this merges. It was a bit difficult to read in a previous PR here, so I'll just wait. 😄 https://github.com/j0sh77/skyline-overlay/pull/1

imjoshin commented 2 years ago

For anyone reviewing, I know it's a lengthier PR, so I'm happy to walk through this with anyone on Discord if needed. 😄

dsrkafuu commented 2 years ago

@j0sh77 Sorry for the long time no reply.

I am in the process of merging the PR into the dev branch and I plan to make the following adjustments based on this PR in the near future:

  1. Create a new settings panel for changing color settings
  2. Support setting theme colors (of course)
  3. Support setting specific color for each job or color for job categories
  4. Provide some color presets
  5. Check the bundle size that introducing react-color will increase and decide whether to choose a alternative
imjoshin commented 2 years ago

@dsrkafuu No worries! I appreciate the time. 😄 If you want help with any of those, feel free to make tasks and I'll do my best to match your style preferences.

Support setting specific color for each job or color for job categories

Also, this would be awesome. I like the idea.