-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: root app layout and styles #33
Conversation
samsiegart
commented
Jan 19, 2023
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.
Gettin' spiffy
<html lang="en"> | ||
<html | ||
lang="en" | ||
class="h-full bg-gradient-to-b from-interYellow to-interOrange bg-no-repeat bg-fixed" |
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 class the <html>
instead of <body>
?
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.
For the background color, I want it to affect the entire page even if there's no content. This way we don't have to artificially stretch the body out to fill the whole screen just to apply the background.
@@ -50,34 +57,26 @@ const App = () => { | |||
}, [setError, leader, netConfig, setLeader]); | |||
|
|||
return ( | |||
<> | |||
<div> |
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.
to make sure I understand, was this necessary?
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.
Ah nope.
return `...${chainConnection.address.substring( | ||
chainConnection.address.length - 7, | ||
)} Connected`; |
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.
consider a helper,
return `...${chainConnection.address.substring( | |
chainConnection.address.length - 7, | |
)} Connected`; | |
return `...${truncatedAddress(chainConnection)} Connected`; |
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
@@ -10,5 +12,9 @@ | |||
--color-alternative-bright: #fafafa; | |||
--color-primary: #c084fc; | |||
--color-primary-dark: #a855f7; | |||
--color-mineShaft: #484848; |
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 name is so specific as to not be a variable. Please name it for a role (e.g. text
) or an approximate color (like gray
)
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 considered that but this color is referred to as "mine shaft" in the figma. It's also used a couple places not as text. I figured it would be easier for maintainers referring to the figma to reference it in the code as the same name. I could maybe add an alias for it in tailwind.config.cjs?
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 get why the Figma would use it, because they're designing a screen that doesn't have to be maintained. In code we should not name literal colors. If there were more time I'd say to work with the designers to understand how they use "mine shaft" and ask them to give it a semantic name. But I won't block on this.
|
||
const MainContentCard = ({ children, header, subheader }: Props) => { | ||
return ( | ||
<div className="w-full bg-gradient-to-br from-[#fffcf2] to-[#ffffff] rounded-t-3xl rounded-b-xl shadow-[0px_34px_50px_0px_#ff7a1a]"> |
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'm not familiar with this brackets in className syntax. Is some part of the build chain making classes on the fly?
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.
Yea, I could also define a custom class but just went with this method because these values are quite bespoke.
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.
@@ -1,7 +1,7 @@ | |||
/** @type {import('tailwindcss').Config} */ | |||
module.exports = { | |||
mode: 'jit', // update this line | |||
content: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'], | |||
content: ['./src/**/*.{js,jsx,ts,tsx}', './index.html'], |
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.
Yea just to be clear, tailwind prunes all classes not used by any of these files. So the classes I put in index.html that weren't used elsewhere were being pruned without this change, pretty cool!
…exit exit with error upon unknown commands