From 49c90de23267e7cf12565727dbd1a2e5015ee4e7 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Wed, 16 Aug 2023 17:00:53 -0500 Subject: [PATCH] feat: Add mwfc. (#114) * feat: Add mwfc. * Codegen. * Fix abbreviation. --- packages/template-tachyons/src/Css.ts | 24 +++++++++++++++++++ packages/testing-tachyons/src/Css.ts | 24 +++++++++++++++++++ .../truss/src/sections/tachyons/widths.ts | 6 +++++ 3 files changed, 54 insertions(+) diff --git a/packages/template-tachyons/src/Css.ts b/packages/template-tachyons/src/Css.ts index f3706fa..c743981 100644 --- a/packages/template-tachyons/src/Css.ts +++ b/packages/template-tachyons/src/Css.ts @@ -2339,6 +2339,18 @@ class CssBuilder { get mw100() { return this.add("minWidth", "100%"); } + /** Sets `minWidth: "fit-content"`. */ + get mwfc() { + return this.add("minWidth", "fit-content"); + } + /** Sets `minWidth: "min-content"`. */ + get mwminc() { + return this.add("minWidth", "min-content"); + } + /** Sets `minWidth: "max-content"`. */ + get mwmaxc() { + return this.add("minWidth", "max-content"); + } /** Sets `minWidth: value`. */ mw(value: Properties["minWidth"]) { return this.add("minWidth", value); @@ -2367,6 +2379,18 @@ class CssBuilder { get maxw100() { return this.add("maxWidth", "100%"); } + /** Sets `maxWidth: "fit-content"`. */ + get maxwfc() { + return this.add("maxWidth", "fit-content"); + } + /** Sets `maxWidth: "min-content"`. */ + get maxwminc() { + return this.add("maxWidth", "min-content"); + } + /** Sets `maxWidth: "max-content"`. */ + get maxwmaxc() { + return this.add("maxWidth", "max-content"); + } /** Sets `maxWidth: value`. */ maxw(value: Properties["maxWidth"]) { return this.add("maxWidth", value); diff --git a/packages/testing-tachyons/src/Css.ts b/packages/testing-tachyons/src/Css.ts index cbc3187..a44a6e2 100644 --- a/packages/testing-tachyons/src/Css.ts +++ b/packages/testing-tachyons/src/Css.ts @@ -2045,6 +2045,18 @@ class CssBuilder { get mw100() { return this.add("minWidth", "100%"); } + /** Sets `minWidth: "fit-content"`. */ + get mwfc() { + return this.add("minWidth", "fit-content"); + } + /** Sets `minWidth: "min-content"`. */ + get mwminc() { + return this.add("minWidth", "min-content"); + } + /** Sets `minWidth: "max-content"`. */ + get mwmaxc() { + return this.add("minWidth", "max-content"); + } /** Sets `minWidth: value`. */ mw(value: Properties["minWidth"]) { return this.add("minWidth", value); @@ -2073,6 +2085,18 @@ class CssBuilder { get maxw100() { return this.add("maxWidth", "100%"); } + /** Sets `maxWidth: "fit-content"`. */ + get maxwfc() { + return this.add("maxWidth", "fit-content"); + } + /** Sets `maxWidth: "min-content"`. */ + get maxwminc() { + return this.add("maxWidth", "min-content"); + } + /** Sets `maxWidth: "max-content"`. */ + get maxwmaxc() { + return this.add("maxWidth", "max-content"); + } /** Sets `maxWidth: value`. */ maxw(value: Properties["maxWidth"]) { return this.add("maxWidth", value); diff --git a/packages/truss/src/sections/tachyons/widths.ts b/packages/truss/src/sections/tachyons/widths.ts index cc682cf..ecd9cb5 100644 --- a/packages/truss/src/sections/tachyons/widths.ts +++ b/packages/truss/src/sections/tachyons/widths.ts @@ -25,6 +25,9 @@ export const width: CreateMethodsFn = (config) => [ mw50: "50%", mw75: "75%", mw100: "100%", + mwfc: "fit-content", + mwminc: "min-content", + mwmaxc: "max-content", }, "mw", true, @@ -38,6 +41,9 @@ export const width: CreateMethodsFn = (config) => [ maxw50: "50%", maxw75: "75%", maxw100: "100%", + maxwfc: "fit-content", + maxwminc: "min-content", + maxwmaxc: "max-content", }, "maxw", true,