Skip to content

DS-1156 | v8 - upgrade to TW v4#950

Draft
yvonnetangsu wants to merge 32 commits into
mainfrom
v8
Draft

DS-1156 | v8 - upgrade to TW v4#950
yvonnetangsu wants to merge 32 commits into
mainfrom
v8

Conversation

@yvonnetangsu

Copy link
Copy Markdown
Member

READY FOR REVIEW/NOT READY

  • (Edit the above to reflect status)

Summary

  • TL;DR - what's this PR for?

Needed By (Date)

  • When does this need to be merged by?

Urgency

  • How critical is this PR?

Steps to Test

  1. Do this
  2. Then this
  3. Then this

Affected Projects or Products

  • Does this PR impact any particular projects, products, or modules?

Associated Issues and/or People

  • JIRA ticket
  • Other PRs
  • Any other contextual information that might be helpful (e.g., description of a bug that this PR fixes, new functionality that it adds, etc.)
  • Anyone who should be notified? (@mention them here)

See Also

@yvonnetangsu yvonnetangsu added the alpha Releases an alpha tag label Sep 3, 2025
Comment thread src/css/utilities.css
@@ -0,0 +1,27 @@
/**
Custom variants

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Neat.

Comment thread src/css/base.css

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does TW4 ship with a css reset still?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I plan on thinking a bit more about this as well 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

TW4 by default does come with preflight/reset styles:
https://tailwindcss.com/docs/preflight

It is possible to exclude it, perhaps I'll set up an import option without the preflight.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well, if the expectation is that this package is always imported into another tailwind projet, perhaps we never include it here?

That is only important, however, if the preflight is being doubled up on the export.

If it is coming out the end with just one set of resets, then all is good.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah good point - I'll double check 👍🏼

Comment thread src/css/components.css Outdated
Comment on lines +622 to +625
.wysiwyg {
> *:first-child {
margin-top: -0.25em;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess one nice thing about moving to a CSS based config is that you can write natural css again.

Comment thread src/css/dev.css Outdated
Comment thread src/css/theme.css Outdated
@@ -0,0 +1,226 @@
@theme {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How you feeling about having all of these values pulled from a Figma file one day?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any thoughts on having a core and semantic layer?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Still playing around with things 😄 Going to think about everything some more

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Any thoughts on having a core and semantic layer?

I'm thinking that Decanter core wouldn't have a semantic layer, because other than maybe --color-brand would be universal, we can't really predict what other projects will use for background or default border or subtle (can be fog-light, can be black-10 or a custom color like for homesite) 🤔 Perhaps the semantic layer will be defined in individual projects @sherakama and tagging @iamrentman

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That sounds reasonable to me.

One thought as you use this and learn more, perhaps create an optional semantic layer in which other teams could opt-in to. eg:

@import "decanter";
@import "decanter/semantic-vars";

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@sherakama I could for sure, perhaps UComm @iamrentman could work with us to define a set of semantic variables?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for calling this out. I was wondering the same thing as I browse this and better understand Tailwind v4. I think you're right, @yvonnetangsu – semantic layer is in the project utilizing these primitive values.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hi @iamrentman 👋🏼 If you feel like we could add a "recommended" set of semantic variables, we can certainly add that. There is no rush, we can think about this some more - I'm also thinking about things.

Comment thread src/css/components.css Outdated
}

/* Responsive grid gap */
.grid-gap {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I could argue this is more of a utility than a component. But I won't die on that hill.

@yvonnetangsu yvonnetangsu Sep 3, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah the reason I put it in component is that you can override it with the core utilities, so for example, if using grid-gap gap-y-10, the gap-y-10 will override the vertical gap in grid-gap

Comment thread src/css/components.css Outdated
Comment on lines +226 to +236
.text-shadow {
text-shadow: rgba(0, 0, 0, 40%) 0 0 6px, rgba(0, 0, 0, 60%) 0 0 2px;
}

.text-shadow-md {
text-shadow: rgba(0, 0, 0, 40%) 0 0 8px, rgba(0, 0, 0, 60%) 0 0 3px;
}

.text-shadow-lg {
text-shadow: rgba(0, 0, 0, 30%) 0 0 12px;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Utilities imho.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm going to think about what to do with these because TW has core support for text shadows now

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

But yeah this one is a utility because it doesn't need to be overridden by anything else 👍🏼

@sherakama

Copy link
Copy Markdown
Member

With presets gone, is it now just @import decanter in the project stylesheet?

Comment thread src/css/utilities.css
Comment on lines +251 to +288
/**
Responsive spacing - gap
*/
@utility rs-gap-* {
gap: --value(--responsive-spacing-xs-*);

@media (min-width: 768px) {
gap: --value(--responsive-spacing-md-*);
}

@media (min-width: 1500px) {
gap: --value(--responsive-spacing-2xl-*);
}
}

@utility rs-gap-x-* {
column-gap: --value(--responsive-spacing-xs-*);

@media (min-width: 768px) {
column-gap: --value(--responsive-spacing-md-*);
}

@media (min-width: 1500px) {
column-gap: --value(--responsive-spacing-2xl-*);
}
}

@utility rs-gap-y-* {
row-gap: --value(--responsive-spacing-xs-*);

@media (min-width: 768px) {
row-gap: --value(--responsive-spacing-md-*);
}

@media (min-width: 1500px) {
row-gap: --value(--responsive-spacing-2xl-*);
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Justin asked for this so adding it

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh hey! Neat. Thank you!

@yvonnetangsu

Copy link
Copy Markdown
Member Author

With presets gone, is it now just @import decanter in the project stylesheet?

Yup, from what I understand, it's basically just importing what you need 😬

Comment thread src/css/utilities.css Outdated
Comment on lines +286 to +288
@utility text-* {
font-size: calc(--value(integer) * var(--font-size));
}

@yvonnetangsu yvonnetangsu Sep 4, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Font size utility - it supports any integer values, so text-100 would be font-size: 10rem. It's an extension so all our custom font size classes, eg, text-1em, still works.

Comment thread src/css/components/all-no-forms.css Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My $0.02, kill this file.

Allow someone to easily import everything or individual items. If forms is an issue, perhaps look at breaking it up and into individual components too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure I'll kill it 🔪

*/

@layer components {
.types

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
.types
.types,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh wait, this is a descendant selector. Why do we need .types .splash-text and .splash-text?

@yvonnetangsu yvonnetangsu Sep 5, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh I haven't cleaned up a lot of the stuff - some of it I had AI move things around 😂 I'll go back and see if I can rewrite the modular type stuff in a cleaner way too.
What are you doing here by the way @sherakama ? 👀

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I want to rethink some of this typography styles btw

Comment on lines +2 to +7
--responsive-spacing-xs-neg2: 0.8rem;
--responsive-spacing-md-neg2: 0.9rem;
--responsive-spacing-2xl-neg2: 1rem;
--responsive-spacing-xs-neg1: 1.1rem;
--responsive-spacing-md-neg1: 1.2rem;
--responsive-spacing-2xl-neg1: 1.3rem;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm thinking about deprecating these negative values. I'll add doc in the upgrade.md, e.g.,
rs-p-neg1 => p-11 md:p-12 2xl:p-13
What do you think? @iamrentman @sherakama

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, I am find with that as I feel they break convention.

Deprecate them in V7, and remove in V8.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sounds good @sherakama - I'll start a list of things to be deprecated in decanter v7

Comment on lines +17 to +23
@utility fluid-type-0 {
font-size: clamp(1.8rem, 0.44vw + 1.64rem, 2.3rem);
}

@utility fluid-type-1 {
font-size: clamp(2.1rem, 0.7vw + 1.85rem, 2.9rem);
}

@yvonnetangsu yvonnetangsu Oct 2, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Add fluid type as utilities instead of components. Apparently in TW v4, things like lg:fluid-type-4 (when you use a modifier) stops working if fluid-type is a component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alpha Releases an alpha tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants