diff --git a/.changeset/gold-carrots-notice.md b/.changeset/gold-carrots-notice.md new file mode 100644 index 00000000000..e8edf30cf60 --- /dev/null +++ b/.changeset/gold-carrots-notice.md @@ -0,0 +1,19 @@ +--- +"@kaizen/tailwind": major +--- + +Fix long utility strings for borders in Tailwind (in combination with the introduction of `@kaizen/reset.css`) + +**note: these utilities will not work without installing `@kaizen/reset.css`** + +- Adds DEFAULT values to `borderWidth` and `borderColor` in the Tailwind preset, so these don't need to be written with utility classes. + +These changes mean that border styles require much less utility classes to be written. +For example, to add a border-bottom to an element, we would previously need to write: +``` +className="border-b-default border-l-none border-r-none border-t-none border-solid border-purple-800" +``` +We can now achieve the same css by simply writing: +``` +className="border-b" +``` diff --git a/.changeset/quiet-poems-hammer.md b/.changeset/quiet-poems-hammer.md new file mode 100644 index 00000000000..3e99ef6fcc5 --- /dev/null +++ b/.changeset/quiet-poems-hammer.md @@ -0,0 +1,9 @@ +--- +"@kaizen/reset.css": major +--- + +Initialising this package with a reset to the border properties to support Tailwind's border default settings. + +- Allows for simpler use of border util classes, ie: border-l +- This will also remove all non-explicit borders, ie: inheritance from native browser styles +- Check your chromatic snapshots and add sensible defaults where required diff --git a/docs/Systems/Tailwind/components/CodeSnippet.tsx b/docs/Systems/Tailwind/components/CodeSnippet.tsx index 0bac3524ce1..5e4c1814250 100644 --- a/docs/Systems/Tailwind/components/CodeSnippet.tsx +++ b/docs/Systems/Tailwind/components/CodeSnippet.tsx @@ -1,4 +1,5 @@ import React, { useState } from "react" +import { ClosedIcon, SurveysIcon } from "~components/Icon" type Props = { text: string @@ -6,7 +7,7 @@ type Props = { } export const CodeSnippet = ({ text, onCopy }: Props): React.ReactElement => { - const [_, setCopyIconIsChecked] = useState(false) + const [copyIconIsChecked, setCopyIconIsChecked] = useState(false) const handleCopy = (utilityClassNameName: string): void => { navigator.clipboard.writeText(text) setCopyIconIsChecked(true) @@ -16,16 +17,19 @@ export const CodeSnippet = ({ text, onCopy }: Props): React.ReactElement => { return ( ) diff --git a/docs/Systems/Tailwind/components/DemoBox.tsx b/docs/Systems/Tailwind/components/DemoBox.tsx index 06c1c2b7e8d..2ed2cf22ded 100644 --- a/docs/Systems/Tailwind/components/DemoBox.tsx +++ b/docs/Systems/Tailwind/components/DemoBox.tsx @@ -6,7 +6,7 @@ type Props = { const DemoBox = ({ classnameOverride }: Props): React.ReactElement => (
diff --git a/docs/Systems/Tailwind/components/UtilityClassTemplate.tsx b/docs/Systems/Tailwind/components/UtilityClassTemplate.tsx index 451d5c23802..21356a6baa1 100644 --- a/docs/Systems/Tailwind/components/UtilityClassTemplate.tsx +++ b/docs/Systems/Tailwind/components/UtilityClassTemplate.tsx @@ -27,22 +27,21 @@ export const UtilityClassTemplate = ({ rules="rows" >background-color: #bde2f5
@@ -40,7 +40,7 @@ export const PseudoSelectors: StoryFn<{ isReversed: boolean }> = ({ diff --git a/docs/Systems/Tailwind/UtilityClassReferences/overview.mdx b/docs/Systems/Tailwind/utility-class-helpers/overview.mdx similarity index 95% rename from docs/Systems/Tailwind/UtilityClassReferences/overview.mdx rename to docs/Systems/Tailwind/utility-class-helpers/overview.mdx index 558af0e4594..70375824d6b 100644 --- a/docs/Systems/Tailwind/UtilityClassReferences/overview.mdx +++ b/docs/Systems/Tailwind/utility-class-helpers/overview.mdx @@ -79,10 +79,10 @@ A visual representation of the CSS generated by the utility class. You can inspe ### 3. Add the utility class to the element ```tsx -