Skip to content

v3.4 #1745

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

Merged
merged 61 commits into from
Dec 19, 2023
Merged

v3.4 #1745

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
d6b86c9
Use insiders build
adamwathan Nov 18, 2023
99f5a59
add subgrid examples
danhollick Nov 25, 2023
c8088b7
fix example
danhollick Nov 25, 2023
5f815b8
test out animation
danhollick Nov 27, 2023
54bd932
Add examples
danhollick Dec 2, 2023
92d8e98
clean up example
danhollick Dec 3, 2023
7ff50d9
light mode pass
danhollick Dec 3, 2023
8399c33
change icon
danhollick Dec 3, 2023
1d70926
add some examples
danhollick Dec 10, 2023
4394c8d
add text-wrap page
danhollick Dec 10, 2023
c9e0bfc
document size
danhollick Dec 10, 2023
797fc7b
Documents min/max height/width default scales
danhollick Dec 10, 2023
fff4791
Documents appearance-auto
danhollick Dec 10, 2023
c35f583
adds a text description
danhollick Dec 10, 2023
a442b01
flesh out example
danhollick Dec 11, 2023
f21c721
Revert "change icon"
danhollick Dec 11, 2023
628363a
Changes customisation example (#1733)
danhollick Dec 12, 2023
f38e0e0
Stashing some work
danhollick Dec 12, 2023
f52c50e
some small fixes
danhollick Dec 12, 2023
319b32e
removes percentage examples
danhollick Dec 12, 2023
5578c56
Fleshes out examples
danhollick Dec 15, 2023
d8367d2
messing around with the examples
danhollick Dec 16, 2023
b912de4
tweak example
danhollick Dec 16, 2023
2bdc9be
Flesh out examples
danhollick Dec 18, 2023
db89706
add `forced-color-adjust` page
danhollick Dec 18, 2023
47a41b8
fix examples based on feedback
danhollick Dec 18, 2023
633aa90
Some small edits
danhollick Dec 18, 2023
fcbf4d1
Update insiders version
danhollick Dec 18, 2023
31e8820
Revert "Update insiders version"
danhollick Dec 18, 2023
8838a03
.4: Auto stash before revert of "Update insiders version"
danhollick Dec 18, 2023
53eaadc
Add examples
danhollick Dec 18, 2023
3dcbf06
Documents * modifier (#1744)
danhollick Dec 18, 2023
9385fb9
Update to latest insiders
reinink Dec 18, 2023
00ecdcd
Merge branch 'document-float-start/end' into v3.4
reinink Dec 18, 2023
cd01c09
Merge branch 'document-subgrid' into v3.4
reinink Dec 18, 2023
67cc070
Merge branch 'document-dynamic-viewport-heights' into v3.4
reinink Dec 18, 2023
65a4552
Merge branch 'document-has' into v3.4
reinink Dec 18, 2023
3d97259
Merge remote-tracking branch 'origin/document-text-balance-and-pretty…
reinink Dec 18, 2023
2ef2c44
Merge remote-tracking branch 'origin/document-size-utilities' into v3.4
reinink Dec 18, 2023
7e6373a
Merge remote-tracking branch 'origin/document-min/max-scales' into v3.4
reinink Dec 18, 2023
70118b2
Merge remote-tracking branch 'origin/document-appearance-auto' into v3.4
reinink Dec 18, 2023
2791fa0
Merge remote-tracking branch 'origin/document-forced-colors' into v3.4
reinink Dec 18, 2023
bc2c0df
Merge branch 'master' into v3.4
reinink Dec 18, 2023
32ac3c5
Add `@heroicons/react` package
reinink Dec 18, 2023
6b06c99
Fix `forced-color-adjust` class table
reinink Dec 19, 2023
9aecc5d
Update `className` instead of `class`
reinink Dec 19, 2023
552dfe6
Move `overscroll-none` to parent in `DynamicViewportExample`
reinink Dec 19, 2023
90e2548
Dynamically generate `text-wrap` utilities
reinink Dec 19, 2023
3de2c85
Formatting
reinink Dec 19, 2023
ebce2b7
Formatting
reinink Dec 19, 2023
c512ecf
Formatting
reinink Dec 19, 2023
290577f
Formatting
reinink Dec 19, 2023
f12291e
Improve v3.4 docs
reinink Dec 19, 2023
d12d190
WIP
adamwathan Dec 18, 2023
1f48209
WIP
adamwathan Dec 18, 2023
ced7dc9
v3.4 draft
adamwathan Dec 19, 2023
5e02109
WIP
adamwathan Dec 19, 2023
a8d140f
More blog postin
adamwathan Dec 19, 2023
399bbfa
Update to Tailwind CSS v3.4
adamwathan Dec 19, 2023
d12be5b
Merge branch 'master' into v3.4
adamwathan Dec 19, 2023
9a48680
Update package-lock.json
adamwathan Dec 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12,067 changes: 1,188 additions & 10,879 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@badrap/bar-of-progress": "^0.1.1",
"@docsearch/react": "^3.3.3",
"@headlessui/react": "^1.7.2",
"@heroicons/react": "^0.0.0-insiders.9600adb",
"@heroicons/react": "^2.1.1",
"@mdx-js/loader": "^2.3.0",
"@mdx-js/react": "^2.3.0",
"@silvenon/remark-smartypants": "^1.0.0",
Expand Down Expand Up @@ -60,6 +60,7 @@
"seedrandom": "^3.0.5",
"simple-functional-loader": "^1.2.1",
"stringify-object": "^3.3.0",
"tailwindcss": "^3.4.0",
"tinytime": "^0.2.6",
"unified": "^10.1.2",
"unist-util-filter": "^4.0.1",
Expand All @@ -78,7 +79,6 @@
"eslint-plugin-react": "7.x",
"eslint-plugin-react-hooks": "2.x",
"glyphhanger": "^5.0.0",
"prettier": "^2.5.0",
"tailwindcss": "^3.3.7"
"prettier": "^2.5.0"
}
}
249 changes: 249 additions & 0 deletions src/components/DynamicViewportHeights/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
import React, { useState, useRef, useEffect } from 'react'
import { motion, useElementScroll } from 'framer-motion'
import clsx from 'clsx'

const viewport = {
lvh: 491,
svh: 443,
navBarHeight: 48,
width: 300,
padding: 5,
}

const transition = {
duration: 0.2,
ease: 'linear',
type: 'tween',
}
export function DynamicViewportExample({
unit = 'dvh',
colorStyles = 'dark:bg-blue-500 bg-blue-500 border border-blue-400',
containerBackground = 'bg-stripes-blue',
}) {
const [hidden, setHidden] = useState(false)
const parent = useRef(null)

const { scrollY } = useElementScroll(parent)

useEffect(() => {
const unsub = scrollY.onChange((latest) => {
const previous = scrollY.getPrevious()
if (latest > previous) {
setHidden(true)
} else {
setHidden(false)
}
})

return () => unsub()
})

// NOTE:When upgrading Framer Motion we can use useMotionValueEvent instead:

// import { motion, useScroll, useMotionValueEvent } from 'framer-motion'

// const { scrollY } = useScroll({ container: parent })

// useMotionValueEvent(scrollY, 'change', (latest) => {
// const previous = scrollY.getPrevious()
// if (latest > previous) {
// setHidden(true)
// } else {
// setHidden(false)
// }
// })

return (
<>
<div className="not-prose mb-4">
<div className="flex space-x-2">
<svg
className="flex-none w-5 h-5"
viewBox="0 0 20 20"
fill="none"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<path
d="m9.813 9.25.346-5.138a1.276 1.276 0 0 0-2.54-.235L6.75 11.25 5.147 9.327a1.605 1.605 0 0 0-2.388-.085.018.018 0 0 0-.004.019l1.98 4.87a5 5 0 0 0 4.631 3.119h3.885a4 4 0 0 0 4-4v-1a3 3 0 0 0-3-3H9.813Z"
className="stroke-slate-400 dark:stroke-slate-300"
/>
<path
d="M3 5s.35-.47 1.25-.828m9.516-.422c2.078.593 3.484 1.5 3.484 1.5"
className="stroke-slate-400 dark:stroke-sky-400"
/>
</svg>
<p className="text-slate-700 text-sm font-medium dark:text-slate-200">
Scroll up and down in the viewport to hide/show the browser UI
</p>
</div>
</div>
<div className="not-prose relative bg-slate-50 rounded-xl overflow-hidden dark:bg-slate-800/25 md:px-8 py-8 px-4">
<div className="relative grid justify-items-center">
<div
ref={parent}
style={{ width: `${viewport.width}px`, height: `${viewport.lvh}px` }}
className={clsx(
containerBackground,
'relative rounded-lg border dark:border-slate-700 overscroll-none border-slate-300 text-center text-xs overflow-y-scroll no-scrollbar'
)}
>
<motion.div
className="absolute w-full overflow-hidden snap-start"
transition={{
...transition,
}}
variants={{
visible: {
y: 0,
height: `${viewport.lvh}px`,
},
hidden: {
y: `-${viewport.navBarHeight - 2}px`,
height: `${viewport.lvh + viewport.navBarHeight - 1}px`,
},
}}
initial="visible"
animate={hidden ? 'hidden' : 'visible'}
>
<div className=" w-full grid grid-cols-[auto,1fr,auto] items-center justify-start gap-4 rounded-t-lg border-b border-slate-300 dark:border-slate-600 dark:bg-slate-800 bg-slate-100 px-3 h-[48px]">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="currentColor"
className="h-5 w-5 text-slate-600 dark:text-slate-400"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"
/>
</svg>
<div className="w-full rounded-full border border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-700 px-4 py-1 text-slate-600 dark:text-slate-400">
tailwindcss.com
</div>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="currentColor"
className="h-5 w-5 text-slate-600 dark:text-slate-400"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"
/>
</svg>
</div>
<motion.div
className="w-full p-[7px] h-full pointer-events-none "
transition={{
...transition,
duration: 0.2,
// duration: unit === 'dvh' ? 0.4 : 0.2,
delay: unit === 'dvh' ? 0.4 : 0,
}}
variants={{
visible: {
maxHeight: `${unit === 'lvh' ? viewport.lvh : viewport.svh - 2}px`,
},
hidden: {
maxHeight: `${unit === 'svh' ? viewport.svh : viewport.lvh - 1}px`,
},
}}
initial="visible"
animate={hidden ? 'hidden' : 'visible'}
>
<div
className={clsx(
colorStyles,
'text-slate-50 font-mono font-bold py-4 w-full h-full gap-5 rounded-md grid grid-rows-[1fr_auto_1fr] items-center content-center self-center justify-items-center overflow-hidden'
)}
>
{/* <div className="grid grid-rows-[1fr] h-full items-start overflow-y-hidden">
<svg
className="w-[12px] text-pink-300"
viewBox="0 0 9 162"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M4.5 161.5V1M4.5 1L8.5 5M4.5 1L0.5 5"
stroke="currentColor"
// strokeWidth={1.5}
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div> */}
<div className="grid grid-rows-[1px_1fr] h-full justify-items-center">
<div className="bg-white/60 w-[12px] h-full"></div>
<div className="bg-white/40 w-[1.5px] h-full"></div>
</div>
<p>h-{unit}</p>

{/* <div className="grid grid-rows-[1fr] h-full items-end overflow-y-hidden">
<svg
className="w-[12px] text-pink-300"
viewBox="0 0 10 162"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.00001 1L5 161.5M5 161.5L1 157.5M5 161.5L9 157.5"
stroke="currentColor"
// strokeWidth={1.5}
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div> */}
<div className="grid grid-rows-[1fr_1px] h-full justify-items-center">
<div className="bg-white/40 w-[1.5px] h-full"></div>
<div className="bg-white/60 w-[12px] h-full"></div>
</div>
</div>
</motion.div>
</motion.div>
</div>
{unit === 'lvh' && (
<motion.div
transition={{
...transition,
}}
variants={{
visible: {
bottom: `-${viewport.navBarHeight}px`,
height: `${viewport.navBarHeight}px`,
},
hidden: {
bottom: '5px',
height: '0px',
},
}}
initial="visible"
animate={hidden ? 'hidden' : 'visible'}
// For some reason putting this in a tailwind class doesn't work
style={{ width: `${viewport.width - 12}px` }}
className={clsx(
colorStyles,
'opacity-20 rounded-b-md absolute left-0 right-0 mx-auto'
)}
></motion.div>
)}{' '}
</div>
<div
style={{ backgroundPosition: '10px 10px' }}
className=" z-[-1] pointer-events-none absolute inset-0 bg-grid-slate-100 [mask-image:linear-gradient(0deg,#fff,rgba(255,255,255,0.6))] dark:bg-grid-slate-700/25 dark:[mask-image:linear-gradient(0deg,rgba(255,255,255,0.1),rgba(255,255,255,0.5))]"
/>
<div className="z-[-1] pointer-events-none absolute inset-0 border border-black/5 rounded-xl dark:border-white/5" />
</div>
</>
)
}
2 changes: 1 addition & 1 deletion src/components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function Frame({ className, color = 'sky', children }) {
export function EditorPane({ filename, scroll = false, code, children }) {
return (
<div className="pt-2 bg-slate-800 shadow-lg group">
<TabBar primary={{ name: filename }} showTabMarkers={false} />
{filename && <TabBar primary={{ name: filename }} showTabMarkers={false} />}
<div
className={clsx(
'children:my-0 children:!shadow-none children:bg-transparent',
Expand Down
13 changes: 13 additions & 0 deletions src/css/utilities.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,16 @@
.changing-theme * {
transition: none !important;
}


/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}

4 changes: 3 additions & 1 deletion src/navs/documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const documentationNav = {
pages['height'],
pages['min-height'],
pages['max-height'],
pages['size'],
],
Typography: [
pages['font-family'],
Expand All @@ -126,6 +127,7 @@ export const documentationNav = {
pages['text-underline-offset'],
pages['text-transform'],
pages['text-overflow'],
pages['text-wrap'],
pages['text-indent'],
pages['vertical-align'],
pages['whitespace'],
Expand Down Expand Up @@ -226,7 +228,7 @@ export const documentationNav = {
pages['will-change'],
],
SVG: [pages['fill'], pages['stroke'], pages['stroke-width']],
Accessibility: [pages['screen-readers']],
Accessibility: [pages['screen-readers'], pages['forced-color-adjust']],
'Official Plugins': [
pages['typography-plugin'],
{
Expand Down
Binary file added src/pages/blog/tailwindcss-v3-4/card.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading