-
Notifications
You must be signed in to change notification settings - Fork 3
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
SG's Little Fixes #242
SG's Little Fixes #242
Conversation
unfortunately, we need to add this to the `<body>` tag because modals (and perhaps script menus eventually) get moved outside of the main div by headless ui, so they don't take on the dark mode classes without this being at a higher level. Tailwind recommends this being at the body or html tag level, so I think this little dom manipulation is ok.
this is mentioned in GTCMT/earsketch#2260
} else { | ||
document.body.classList.remove(("dark")) | ||
} | ||
}, [theme]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I see why this is necessary.
At some point, we might want to add a bit of JS to do this in public/index.html
(though I think this is moot for now because our tailwind CSS isn't loaded yet), and perhaps respect the OS/browser theme setting by default.
(See https://tailwindcss.com/docs/dark-mode#toggling-dark-mode-manually)
scripts/src/app/SoundUploader.tsx
Outdated
<input type="radio" style={{ marginRight: "0.75rem" }} checked={index === selected} | ||
<div className="overflow-y-auto border px-3 border-gray-300 dark:border-gray-500" style={{ maxHeight: "300px" }}> | ||
{results.map((result, index) => <div key={index} className={index === selected ? "bg-blue-200 dark:bg-blue-900" : ""}> | ||
<div className="grid grid-flow-col items-center pt-3"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh, grid layout
scripts/src/app/SoundUploader.tsx
Outdated
{results.map((result, index) => <div key={index}> | ||
<label> | ||
<input type="radio" style={{ marginRight: "0.75rem" }} checked={index === selected} | ||
<div className="overflow-y-auto border px-3 border-gray-300 dark:border-gray-500" style={{ maxHeight: "300px" }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job on the UI here. Two requests:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why Firefox, why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, this is fixed, and back as children of the <label>
scripts/src/app/SoundUploader.tsx
Outdated
<div className="overflow-y-auto border px-3 border-gray-300 dark:border-gray-500" style={{ maxHeight: "300px" }}> | ||
{results.map((result, index) => <div key={index} className={index === selected ? "bg-blue-200 dark:bg-blue-900" : ""}> | ||
<div className="grid grid-flow-col items-center pt-3"> | ||
<input id={"fs" + index} type="radio" style={{ marginRight: "0.75rem" }} checked={index === selected} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that the dynamic IDs here are for the benefit of the <label>
s.
Could we make these elements children of the <label>
and scrap the IDs, or does that mess up the layout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably be done with enough non-tailwind css. Would need to push the label back out to the right, because this would put it on the left. Not sure we could use grid either, as these would be children instead of siblings.
I don't think it's worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done now
scripts/src/user/Notifications.tsx
Outdated
failure2: "#d73636", | ||
success: "#065f46", | ||
failure1: "#b91c1c", | ||
failure2: "#b91c1c", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good; per our discussion, I'm guessing this will either grow to include background colors or get moved to its own PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, and let's replace failure1
and failure2
with just failure
, and get rid of fallback
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done now
dark
class back up to<body>
tag to capture modals which get moved outside of the main<div>
by headlessCurrent layout
New Layout