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

feat: root app layout and styles #33

Merged
merged 2 commits into from
Jan 20, 2023
Merged

feat: root app layout and styles #33

merged 2 commits into from
Jan 20, 2023

Conversation

samsiegart
Copy link
Collaborator

image

Copy link
Member

@turadg turadg left a 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"
Copy link
Member

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>?

Copy link
Collaborator Author

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>
Copy link
Member

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nope.

Comment on lines 23 to 25
return `...${chainConnection.address.substring(
chainConnection.address.length - 7,
)} Connected`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider a helper,

Suggested change
return `...${chainConnection.address.substring(
chainConnection.address.length - 7,
)} Connected`;
return `...${truncatedAddress(chainConnection)} Connected`;

Copy link
Collaborator Author

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;
Copy link
Member

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)

Copy link
Collaborator Author

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?

Copy link
Member

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]">
Copy link
Member

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?

Copy link
Collaborator Author

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.

Copy link
Member

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'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator Author

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!

@samsiegart samsiegart merged commit d6dd02f into main Jan 20, 2023
@samsiegart samsiegart deleted the base-styles branch January 20, 2023 22:37
github-actions bot pushed a commit to agoric-labs/dapp-inter that referenced this pull request Jul 23, 2024
…exit

exit with error upon unknown commands
github-actions bot pushed a commit that referenced this pull request Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants