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

Light mode for modal dialogs #7184

Closed
Tracked by #4914
deboer-tim opened this issue May 13, 2024 · 7 comments · Fixed by #7324
Closed
Tracked by #4914

Light mode for modal dialogs #7184

deboer-tim opened this issue May 13, 2024 · 7 comments · Fixed by #7324
Assignees
Labels
kind/enhancement ✨ Issue for requesting an improvement status/need-triage

Comments

@deboer-tim
Copy link
Collaborator

Is your enhancement related to a problem? Please describe

Modal dialogs do not support light mode.

Describe the solution you'd like

Extract colors to the registry and add light mode colors. The component structure is being cleaned up, but we possibly have several of these that need to be moved. e.g. Modal, MessageBox, making sure things like the Feedback form and Container > Create are fixed.

Describe alternatives you've considered

No response

Additional context

No response

@deboer-tim
Copy link
Collaborator Author

If you haven't started I can do the changes to Modal as part of #7187, not sure yet if that'll be all that's required or there are other cases.

@feloy
Copy link
Contributor

feloy commented May 16, 2024

If you haven't started I can do the changes to Modal as part of #7187, not sure yet if that'll be all that's required or there are other cases.

OK, let's make the changes in relation with #7187, I'll check if there are other places to make changes. Thanks

@deboer-tim
Copy link
Collaborator Author

@ekidneyrh the core modal dialog only uses three colors today. Here are the current colors and what I've called them:

  • pd-modal-fade - black (uses to fade the rest of the screen at 60% opacity and a blend-multiply)
  • pd-modal-bg - charcoal-800
  • pd-modal-border - charcoal-500

Let me know if you can think of a better name than 'fade', but I'm assuming the light mode equivalent for the first is safely 'white'. Could you provide light mode color values for the other two?

deboer-tim added a commit to deboer-tim/desktop that referenced this issue May 17, 2024
Adds light mode colors for Modal dialog along with a defined 1px border so that
it is not washed out.

Initial light mode color values are taken from other mappings in the registry.
It is not possible to use bg-opacity-60 with colors from the registry due to
Tailwind CSS post processing order. I looked at several other options (defining
colors as r g b instead of hex, trying several css functions, but the simplest
is just to use direct styling instead.

Fixes containers#7187.
First minor part of containers#7184.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
@ekidneyrh
Copy link
Contributor

ekidneyrh commented May 20, 2024

@ekidneyrh the core modal dialog only uses three colors today. Here are the current colors and what I've called them:

* pd-modal-fade - black (uses to fade the rest of the screen at 60% opacity and a blend-multiply)

* pd-modal-bg - charcoal-800

* pd-modal-border - charcoal-500

Let me know if you can think of a better name than 'fade', but I'm assuming the light mode equivalent for the first is safely 'white'. Could you provide light mode color values for the other two?

Yah white for pd-modal-fade looks good. For pd-model-bg I like the gray-300 used in ur PR or we could go lighter with gray-050, and for the pd-modal-boarder I would go darker and use gray-500. I'll post a screen shot of what im thinking

@ekidneyrh
Copy link
Contributor

modal-light

pd-modal-fade: white
pd-modal-bg: gray-050
pd-modal-boarder: gray-500
pd-modal-header: purple-500
pd-modal-dropdown-header: charcoal-200
pd-modal-dropdown-header-bg: gray-300
pd-modal-dropdown-highlight: purple-300
pd-modal-text: charcoal-300

WDYT of this combo?

deboer-tim added a commit to deboer-tim/desktop that referenced this issue May 23, 2024
Adds light mode colors for Modal dialog along with a defined 1px border so that
it is not washed out.

Initial light mode color values are taken from other mappings in the registry.

Also fixes a nit: the background should have the default cursor and not a
button cursor.

Fixes containers#7187.
First minor part of containers#7184.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
deboer-tim added a commit to deboer-tim/desktop that referenced this issue May 23, 2024
Adds light mode colors for Modal dialog along with a defined 1px border so that
it is not washed out.

Initial light mode color values are taken from other mappings in the registry.

Also fixes a nit: the background should have the default cursor and not a
button cursor.

Fixes containers#7187.
First minor part of containers#7184.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
cdrage pushed a commit that referenced this issue May 23, 2024
Adds light mode colors for Modal dialog along with a defined 1px border so that
it is not washed out.

Initial light mode color values are taken from other mappings in the registry.

Also fixes a nit: the background should have the default cursor and not a
button cursor.

Fixes #7187.
First minor part of #7184.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
@feloy
Copy link
Contributor

feloy commented May 23, 2024

Some dialogs add a shadow at the bottom of the modal box. But the shadow appears inside the border. Do we want to keep the shadow? @deboer-tim @ekidneyrh

modal-shadow

@deboer-tim
Copy link
Collaborator Author

Some dialogs add a shadow at the bottom of the modal box. But the shadow appears inside the border. Do we want to keep the shadow? @deboer-tim @ekidneyrh

These are from one of the earliest designs, and AFAIK the plan was always to replace with what is now the Modal styling - i.e. no drop-shadow just faded screen background. I have a commit where I ran into cases like this and removed them along with cases where we change the bg color unnecessarily, will try to find it and PR soon.

deboer-tim added a commit to deboer-tim/desktop that referenced this issue May 27, 2024
When trying to test containers#7246 I noticed that there are several uses of Modal that
override the background color of Modal or try to add their own shadow or other
styling as per a very old design. This just removes this extraneous styling
so that these dialogs use what is in Modal (including light mode) and remaining
work can focus on what actually needs to change within the dialogs.

Should be more consistent or no change to existing modals, just clears out
unnecessary/duplicate code. IMHO SendFeedback is the only issue here since
two custom fields were being set to the (now) background color, not sure if
I should temporarily set them to another color or skip this for now.

Will need containers#7303 to see the rename image modal.

Part of containers#7184.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
deboer-tim added a commit to deboer-tim/desktop that referenced this issue May 28, 2024
When trying to test containers#7246 I noticed that there are several uses of Modal that
override the background color of Modal or try to add their own shadow or other
styling as per a very old design. This just removes this extraneous styling
so that these dialogs use what is in Modal (including light mode) and remaining
work can focus on what actually needs to change within the dialogs.

Should be more consistent or no change to existing modals, just clears out
unnecessary/duplicate code. IMHO SendFeedback is the only issue here since
two custom fields were being set to the (now) background color, not sure if
I should temporarily set them to another color or skip this for now.

Will need containers#7303 to see the rename image modal.

Part of containers#7184.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement ✨ Issue for requesting an improvement status/need-triage
Projects
Status: ✔️ Done
Development

Successfully merging a pull request may close this issue.

4 participants