-
Notifications
You must be signed in to change notification settings - Fork 991
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
Update scaffold css files to add bg to odd rows and border to segment #5136
Update scaffold css files to add bg to odd rows and border to segment #5136
Conversation
✅ Deploy Preview for redwoodjs-docs canceled.
|
@ccnklc Thank you so much, this is great! It's getting too late for me to give this a proper review right now. I'll try to get to it tomorrow.
This is one of the best things about working with open-source software. Someone just shows up and teaches me new things 👍 Do you have more info about this best practice?
100% personal preference, but I think I prefer the CSS colors. But it would be easier to keep the TW colors and change the CSS ones, right? What's your suggestion here? |
I believe it is mostly about the shift of mindset rather than any particular end result, however when I am working with tables, I always try to imagine them as individuals cells rather than just intersections of columns and rows. It just helps me to think a little bit more out of the box about the things I can do.
I prefer not to use default colors in any project (this is a nice colour palette collection I always checkout before picking some colors ). I would personally define Redwood colors from scratch and store it in tailwind config {
theme: {
colors: {
transparent: 'transparent',
current: 'currentColor',
'white': '#ffffff',
'purple': '#3f3cbb',
'midnight': '#121063',
'metal': '#565584',
'tahiti': '#3ab7bf',
'silver': '#ecebff',
'bubble-gum': '#ff77e9',
'bermuda': '#78dcca',
},
},
} and for css we could use variables to create a similar theme :root {
--bg-midnight: #121063;
}
element {
background-color: var(--bg-midnight);
} |
Hi @ccnklc, thanks for your replies.
Working at a company or with a client this makes a ton of sense. Colors are an integral part of most business identity. For RW we want to stick with the TW defaults in our generators. Both because we know they're carefully curated by the TW team, but also for your reason about not wanting to use default colors - we anticipate that most developers will want to change what the generators look like anyway. So we just want good-enough looking defaults that are easily changed. So maybe just, if you want, define some CSS variables that matches the TW colors we're using 🎨 |
I believe I copied the colors from Tailwind when I created the scaffold styles, but that was Tailwind 2.0. When they went to 3.0 they changed the color palette slightly and then they didn't match up any more. I agree we should use the Tailwind colors as they know what they're doing! I used to style |
This could be the reasoning behind my action without knowing, I forgot it but probably when I was young I had the same issue 😆
I understand why you might want to do this, If the idea is focus on building your startup not fighting for your framework, personally, as someone with a design background, I would like my basic app to have modern layout with nice colour palette, maybe even utilising with redwood-ui-library ( I know it doesn't exist but it would be nice to have one that is fully compatible with forms and stuff), then if I want to delete everything and change colors or my breakpoints, I can always do that. Deleting is a lot easier than building it. I think it would make a huge difference in terms of satisfaction to run create a redwood app for the first time and everything amazes you including the default styles of your new shiny app. Do we need it? Definitely not. |
@Tobbe Here is a pr that extends from this branch for copying tailwind 3 colors into css variables. I am not sure If what I did would nicely copy the colors.css file I have created into the new apps, also I didn't update snapshots and web project in fixtures yet. Just want to get an idea about if I am moving in to the right direction or do you have a better idea about organising these colors in redwood. I have no clue how to handle file creations and deletions in redwood yet, I will need some help to learn more about how we manage these generated files. |
Something's a bit weird with the styling of the bottom part of the table in my browser Exaggerating the radius on Those screenshots are from the linked gitpod project (https://gitpod.io/#https://github.com/redwoodjs/redwood/pull/5136) EDIT: Making the page much narrower we can see it's the scrollbar that's messing things up |
fdce68a
to
ee7600e
Compare
Thanks @ccnklc! That was a great idea splitting that out into its own issue/PR. I'm sorry I got a little bit carried away looking into the scrollbar issue and pushed a bunch of code to your PR 🙈 Please take a look at what I did to make sure you're still ok with having your name on this PR 😬 All tests pass now, so if I can get a ✅ from you I'll merge this. |
…om/ccnklc/redwood into fix/scaffold-border-and-background
@@ -165,6 +175,9 @@ | |||
.rw-table td { | |||
@apply bg-white text-gray-900; | |||
} | |||
.rw-table tr:nth-child(odd) td { |
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.
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.
@Tobbe
Just found another issue, I am not sure what was the intended design but I feel like it would be better to change the backgrounds of ths in tbody, what do you say?
Other than this issuem it looks good to me. ✅
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 agree. That doesn't look good. Is it only a problem for the pure css styles, or for TW too?
I'm also not entirely sure what the intended design is/was. I'll do a little digging.
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.
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.
@Tobbe I have updated branch in my forked repo however I am not sure how to push those changes to this pr to be honest.
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.
@ccnklc You figured it out, right? This is the commit you wanted? "color th s in tbody as well"
Fix for #5116
Changes:
Suggestion:
I have checked the css and tailwind files, it looks like all the colors are different from one another and I believe using tailwind or not shouldn't effect the basic styling for scaffolded components, maybe it would be a good idea to align these colours.
For comparison here are the screenshots:
Tailwind before:
Tailwind after:
Css before:
Css after: