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

Modernize CSS Styles for Text and Figures || chore: update code formatting and styles #10

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions styles/flow/mod.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ pre {
padding: 1rem;
border-radius: var(--bd-radius);
background: var(--bg-muted);
font-size: .85rem;
line-height: 1.45;
font-size: 0.9rem;
line-height: 1.6;
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
Copy link
Owner

Choose a reason for hiding this comment

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

This kind of value should inherit from --shadow property

}

pre > code {
Expand All @@ -28,17 +29,21 @@ pre > code {

/* Quotation block */
blockquote {
padding: .25rem 1rem;
border-left: .25rem solid var(--bd-muted);
margin: 0 0 1rem;
padding: 0.5rem 1.5rem;
border-left: 0.25rem solid var(--primary-color);
Copy link
Owner

Choose a reason for hiding this comment

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

The variable --primary-color doesn't exist
Also no need to add back 0 to numbers, as they don't really grant much readbility and actually increase a bit the resulting size of the file

margin: 0 0 1.5rem;
color: var(--muted);
background: var(--bg-light);
Copy link
Owner

Choose a reason for hiding this comment

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

The variable --bg-light doens't exist, also I'm not convinced a blockquote should have a background color

border-radius: var(--bd-radius);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

blockquote > cite:last-child {
display: block;
padding-left: 2rem;
margin-top: .25rem;
margin-top: 0.5rem;
text-decoration: none;
font-style: italic;
Copy link
Owner

Choose a reason for hiding this comment

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

To remove, this is already in italic

}

blockquote > cite:last-child::before {
Expand All @@ -49,7 +54,13 @@ blockquote > cite:last-child::before {
figure {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
justify-content: center;
align-items: center;
margin: 0 auto 1.5rem;
padding: 1rem;
border-radius: var(--bd-radius);
background: var(--bg-muted);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
SH20RAJ marked this conversation as resolved.
Show resolved Hide resolved
}

figcaption {
Expand All @@ -58,4 +69,5 @@ figcaption {
margin: 1rem 0;
color: var(--muted);
text-align: center;
font-style: italic;
}
45 changes: 30 additions & 15 deletions styles/tables/mod.css
Original file line number Diff line number Diff line change
@@ -1,44 +1,59 @@
/* Modernized table styles */

table {
display: block;
width: 100%;
Copy link
Owner

Choose a reason for hiding this comment

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

The display: block is a trick to make overflowable table without the need of using a wrapper div when width/parent width is set, so I feel like it's better to keep it.

max-width: 100%;
margin: 0 auto 1rem;
border-collapse: collapse;
border-spacing: 0;
inline-size: fit-content;
overflow-x: auto;
border-radius: 0.5rem;
Copy link
Owner

Choose a reason for hiding this comment

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

This has no effect:
image

box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
Copy link
Owner

Choose a reason for hiding this comment

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

This kind of value should inherit from --shadow property

}

.table-responsive {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
display: block;
width: 100%;
Copy link
Owner

Choose a reason for hiding this comment

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

The display: grid; grid-template-columns; cannot be removed actually, because it'll "break" the body size on small screens on many browsers as seen below:
image

For some reason even with overflow: auto this issue occurs, unless a better style exists to fix this issue, I think this should be kept (which include the removed block below)

overflow-x: auto;
}

.table-responsive table {
display: table;
}

caption {
margin-top: .5rem;
margin-top: 0.5rem;
caption-side: bottom;
color: var(--muted);
font-size: 0.875rem;
Copy link
Owner

Choose a reason for hiding this comment

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

Not sure if decreasing font-size on a already muted element is really needed
Especially with the larger padding it looks disproportionate:
image

}

tbody > tr:nth-child(2n) {
background: var(--bg-muted);
}

th, td {
padding: 0.375rem 0.8125rem;
padding: 0.75rem 1rem;
border: 1px solid var(--bd-muted);
text-align: left;
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think aligning to left is needed, it's already the default

}

th {
border-color: var(--bg-contrast);
background: var(--bg-subtle);
font-weight: bold;
font-weight: 600;
color: var(--primary-color);
Copy link
Owner

Choose a reason for hiding this comment

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

The --primary-color doesn't exist.
Also removing the borders on table headers make the table quite difficult to read (especially on colspan):
image

Reducing bolding, uppercasing with letter-spacing seems fine though.

text-transform: uppercase;
letter-spacing: 0.1rem;
}

td {
color: var(--text-color);
Copy link
Owner

Choose a reason for hiding this comment

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

This is variable doesn't exist, and this ruleset is probably not needed neither, cells are already using the --default color so this has no effect

}

table.center td, th {
table.center th, table.center td {
Copy link
Owner

Choose a reason for hiding this comment

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

IMHO th should still be centered even on non-centered tables, because they're table headers

text-align: center;
}
}

/* Hover effects for better interactivity */
tbody tr:hover {
background: var(--bg-hover);
}
Copy link
Owner

Choose a reason for hiding this comment

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

The property --bg-hover doesn't exist so this has actually no effects

Also this was previously in matcha but I decided to remove it because it looks really weird when you start using rowspan attribute


th, td {
transition: background-color 0.3s ease, color 0.3s ease;
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think the :hover effect should be implemented for the reasons mentioned above, but anyways the transitions should used --tr-duration property

}