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

V5 final final #705

Merged
merged 63 commits into from
Feb 12, 2024
Merged

V5 final final #705

merged 63 commits into from
Feb 12, 2024

Conversation

mrmrs
Copy link
Member

@mrmrs mrmrs commented Aug 15, 2022

v1-4 all had the goal of being as absolute light weight as possible. v5 adds a number of modules and a full color system
but still weighs in around 20kb gzipped. Given how much CSS has expanded over the last few years, this added file size I think is reasonable.

Major changes

  • All min-width breakpoints. No -ns scope anymore. Just s,m,l
  • Flipped scale direction for typography (1 is smallest)
  • Moved to x,y syntax instead of h,v
  • Expanded spacing scale
  • New support for CSS grid
  • New layered box shadows
  • New color system optimized for accessibility

TODO

These can likely be follow up minor bumps:

  • Make it easier to customize values
  • Generated gradients from color system
  • Utilities for text gradients
  • Additional shadow hovers
  • Add more options for grid-template-columns and flexible grids
  • Update docs (if only I could get them to build)

mrmrs added 3 commits August 14, 2022 22:09
- New color system
- New support for grid
- Updated scales
- New hover animations
- Min width based media queries
Copy link
Contributor

@dangayle dangayle left a comment

Choose a reason for hiding this comment

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

A lot of nice changes to bring things up to date. I question the mixture of modern CSS things along with remnants of IE support though.

@@ -18,71 +18,8 @@

*/

.b--black { border-color: var(--black); }
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for removing all the border colors?

Copy link

Choose a reason for hiding this comment

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

agreed – we use the border color classes often.

@@ -51,12 +56,14 @@
.br-initial { border-radius: initial; }
.br-unset { border-radius: unset; }

@media (--breakpoint-not-small) {
@media (--breakpoint-small) {
.br0-ns { border-radius: 0; }
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought you were removing all -ns styles

-m = medium
-l = large

*/

.flex { display: flex; }
Copy link
Contributor

Choose a reason for hiding this comment

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

moved to _display.css

@@ -18,32 +18,32 @@
n = none

Media Query Extensions:
-ns = not-small
-ns = small
-m = medium
-l = large

*/



Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you should move the float clears here instead of removing them entirely?

@@ -5,7 +5,19 @@

*/

/* Responsive images! */
img { display: block; max-width: 100%; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think you should be changing a bare img tag like this? This could have unintended side-effects because the selector is too greedy

Copy link

@jzwood jzwood Dec 21, 2022

Choose a reason for hiding this comment

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

Agreed. I appreciate the principle of responsive by default, but this seems like overreach.
maybe it could be opt in? maybe .responsive-image to match the ones below??

@@ -24,6 +24,14 @@ body {
margin: 0;
}

/**
* Render the `main` element consistently in IE.
Copy link
Contributor

Choose a reason for hiding this comment

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

You're adding all this grid stuff and aspect ratios, but still care about IE for this? Seems like you should just make a clean cutoff for the sake of consistency.

@@ -13,7 +13,7 @@
n = none

Media Query Extensions:
-ns = not-small
-ns = small
Copy link
Contributor

Choose a reason for hiding this comment

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

missed an -s

font-size: 5rem;
}


/* Type Scale */
Copy link
Contributor

Choose a reason for hiding this comment

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

Changing the type scale is the biggest breaking change in this PR, IMO. I hope this was well-considered. It makes sense though.

@media (--breakpoint-not-small) {
.clip-ns {
@media (--breakpoint-small) {
.clip-s {
position: fixed !important;
_position: absolute !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

The underscore hack died with IE6, there's no reason that I'm aware of to keep this.

@@ -51,23 +51,15 @@
.w-10 { width: 10%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-33 { width: 33%; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a fan of removing thirds. At the Spokesman-Review, a ton of pages use three up layouts. The 30, 40, etc., are less important, but being able to have 33% is useful.

Choose a reason for hiding this comment

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

agreed. we use it a bit too.

@srevenant
Copy link

I love ALMOST everything but ... I think the switch from h,v to x,y is a mistake. Not only does it have a major impact on upgradability, it's largely a vanity change, without adding anything to usability (infact possibly removing some).

Just saying, as an avid fan of tachyons. I'll likely have to fork the branch to put it back for my project uses.

@srevenant
Copy link

Separately, what about 'row-gap' and 'col-gap' ? We've implemented this in our repo as gh and gv for col/row gaps, and ga for both.

@@ -20,7 +21,7 @@
-pill = 9999px

Media Query Extensions:
-ns = small
-n = small
Copy link

Choose a reason for hiding this comment

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

-s ?

@@ -4,7 +4,7 @@
Docs: http://tachyons.io/docs/typography/tracking/

Media Query Extensions:
-ns = not-small
-ns = small
Copy link

Choose a reason for hiding this comment

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

Suggested change
-ns = small
-s = small

Comment on lines +27 to +28
y = vertical
x = horizontal
Copy link

Choose a reason for hiding this comment

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

h/v are great! I don't understand the motivation to change this 😢

Copy link

@jzwood jzwood Dec 22, 2022

Choose a reason for hiding this comment

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

PR to revert this notation change: #709

@@ -4,27 +4,27 @@
http://tachyons.io/docs/typography/measure/

Media Query Extensions:
-ns = not-small
-ns = small
Copy link

Choose a reason for hiding this comment

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

Suggested change
-ns = small
-s = small

@@ -3,7 +3,7 @@
UTILITIES

Media Query Extensions:
-ns = not-small
-ns = small
Copy link

Choose a reason for hiding this comment

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

Suggested change
-ns = small
-s = small

@@ -22,7 +22,7 @@
.mr-auto { margin-right: auto; }
.ml-auto { margin-left: auto; }

@media (--breakpoint-not-small){
@media (--breakpoint-small){
.center-ns {
Copy link

Choose a reason for hiding this comment

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

Suggested change
.center-ns {
.center-s {

@@ -3,7 +3,7 @@
WHITE SPACE

Media Query Extensions:
-ns = not-small
-ns = small
Copy link

Choose a reason for hiding this comment

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

Suggested change
-ns = small
-s = small

src/_widths.css Outdated
@@ -34,7 +34,7 @@


Media Query Extensions:
-ns = not-small
-ns = small
Copy link

Choose a reason for hiding this comment

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

Suggested change
-ns = small
-s = small

src/_widths.css Outdated
.w-100 { width: 100%; }

.w-third { width: calc(100% / 3); }
.w-two-thirds { width: calc(100% / 1.5); }
.w-auto { width: auto; }

@media (--breakpoint-not-small) {
@media (--breakpoint-small) {
Copy link

Choose a reason for hiding this comment

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

lots of -ns in this media query

@jzwood
Copy link

jzwood commented Dec 22, 2022

to summarize other comments -- ns is still erroneously present in many places.

➜  tachyons git:(v5-final-final) ag "\-ns" src
src/_white-space.css
6:     -ns = small

src/_typography.css
7:     -ns = small

src/_widths.css
37:     -ns = small
63:  .w1-ns {  width: 1rem; }
64:  .w2-ns {  width: 2rem; }
65:  .w3-ns {  width: 4rem; }
66:  .w4-ns {  width: 8rem; }
67:  .w5-ns {  width: 16rem; }
68:  .w-10-ns { width:  10%; }
69:  .w-20-ns { width:  20%; }
70:  .w-25-ns { width:  25%; }
71:  .w-50-ns { width:  50%; }
72:  .w-75-ns { width:  75%; }
73:  .w-100-ns { width: 100%; }
74:  .w-third-ns { width: calc(100% / 3); }
75:  .w-two-thirds-ns { width: calc(100% / 1.5); }
76:  .w-auto-ns { width: auto; }

src/_utilities.css
6:     -ns = small
26:  .center-ns {
30:  .mr-auto-ns { margin-right: auto; }
31:  .ml-auto-ns { margin-left:  auto; }

src/_text-transform.css
16:     -ns = small

src/_font-weight.css
21:     -ns = small

src/_floats.css
21:     -ns = small

src/_letter-spacing.css
7:     -ns = small

PR to fix these: #708

@jzwood
Copy link

jzwood commented Dec 22, 2022

This branch still has .cf { *zoom: 1; } and I'm pretty sure the original IE6 hack doesn't include an asterisk and can be removed? Thanks!! 😃

@gobijan
Copy link

gobijan commented Jul 4, 2023

I'd step up and be willing to fix this branch and also implement a darkmode. I already did this with my own "fork" of tachyons (darkmode and min-width-sizes). See it here: https://screenisland.com/assets/css/tachyons.css

I checked out the branch and found a few things that need work:

  • The index.html page for documentation needs to be adapted
  • Old ns class remains need to be removed and fixed (there is also a PR for this)
  • The compiled css (normal and minimized) do not include the color variables. I think they should be in there to make it easy to get going with just embedding the css file.

Is there something else that needs attention?
Can we bring tachyons back to life?

I often prefer to have a production ready single css file to drop in and forget about. Tailwinds toolchain is often too much.

mrmrs added 11 commits July 12, 2023 13:34
--gradient-color-15: var(--gold-0);
--gradient-color-16: var(--gold-5);
--gradient-color-17: var(--yellow-0);
--gradient-color-18: var(--yellow-5);;
Copy link

Choose a reason for hiding this comment

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

The doubled semicolon needs to be removed.

Suggested change
--gradient-color-18: var(--yellow-5);;
--gradient-color-18: var(--yellow-5);

--shadow-border-width: 1px;
--shadow-opacity: .25;

// Opacity scale
Copy link

Choose a reason for hiding this comment

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

This is not a valid css comment (happens to me also way too often :D)

Suggested change
// Opacity scale
/* Opacity scale */

@gobijan
Copy link

gobijan commented Jul 14, 2023

There is currently a conflict with the .br class it is used for border-right and for border-radius.

@0xdhrv
Copy link

0xdhrv commented Oct 18, 2023

really looking forward this update <3

@mrkhdly mrkhdly merged commit 2486c58 into main Feb 12, 2024
@mrkhdly mrkhdly mentioned this pull request Feb 12, 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.

8 participants