DS-1156 | v8 - upgrade to TW v4#950
Conversation
| @@ -0,0 +1,27 @@ | |||
| /** | |||
| Custom variants | |||
There was a problem hiding this comment.
Does TW4 ship with a css reset still?
There was a problem hiding this comment.
I plan on thinking a bit more about this as well 🤔
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Yeah good point - I'll double check 👍🏼
| .wysiwyg { | ||
| > *:first-child { | ||
| margin-top: -0.25em; | ||
| } |
There was a problem hiding this comment.
I guess one nice thing about moving to a CSS based config is that you can write natural css again.
| @@ -0,0 +1,226 @@ | |||
| @theme { | |||
There was a problem hiding this comment.
How you feeling about having all of these values pulled from a Figma file one day?
There was a problem hiding this comment.
Any thoughts on having a core and semantic layer?
There was a problem hiding this comment.
Still playing around with things 😄 Going to think about everything some more
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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";
There was a problem hiding this comment.
@sherakama I could for sure, perhaps UComm @iamrentman could work with us to define a set of semantic variables?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| /* Responsive grid gap */ | ||
| .grid-gap { |
There was a problem hiding this comment.
I could argue this is more of a utility than a component. But I won't die on that hill.
There was a problem hiding this comment.
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
| .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; | ||
| } |
There was a problem hiding this comment.
I'm going to think about what to do with these because TW has core support for text shadows now
There was a problem hiding this comment.
But yeah this one is a utility because it doesn't need to be overridden by anything else 👍🏼
|
With presets gone, is it now just |
| /** | ||
| 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-*); | ||
| } | ||
| } |
There was a problem hiding this comment.
Justin asked for this so adding it
There was a problem hiding this comment.
Oh hey! Neat. Thank you!
Yup, from what I understand, it's basically just importing what you need 😬 |
| @utility text-* { | ||
| font-size: calc(--value(integer) * var(--font-size)); | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| */ | ||
|
|
||
| @layer components { | ||
| .types |
There was a problem hiding this comment.
| .types | |
| .types, |
There was a problem hiding this comment.
Oh wait, this is a descendant selector. Why do we need .types .splash-text and .splash-text?
There was a problem hiding this comment.
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 ? 👀
There was a problem hiding this comment.
I want to rethink some of this typography styles btw
| --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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Yeah, I am find with that as I feel they break convention.
Deprecate them in V7, and remove in V8.
There was a problem hiding this comment.
Sounds good @sherakama - I'll start a list of things to be deprecated in decanter v7
…ect ratio plugin from dev.css; clean up WIP; remove backface-hidden utility because it's in TW v4 core now
| @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); | ||
| } |
There was a problem hiding this comment.
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.
…lass for the 16x9 container
READY FOR REVIEW/NOT READY
Summary
Needed By (Date)
Urgency
Steps to Test
Affected Projects or Products
Associated Issues and/or People
@mentionthem here)See Also