Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0aa819f
Feat: Add tailwind plugin
jlukic Jun 10, 2025
3aa07eb
Chore: Update license to 2025
jlukic Jun 10, 2025
d9fd60e
Bug: Fix typo in endSVG contentBranch
jlukic Jun 10, 2025
6eb836e
Chore: remove log in playground in docs
jlukic Jun 10, 2025
0c28ab8
Add example of using tailwinds
jlukic Jun 10, 2025
3efe34a
Feat: Tailwinds plugins update tailwind utils
jlukic Jun 10, 2025
5bb3a9e
Chore: Update lockfile
jlukic Jun 10, 2025
a431c23
Chore: Add tailwinds to release notes
jlukic Jun 10, 2025
5f7ac0f
Docs: remove orphaned example for tailwinds
jlukic Jun 10, 2025
7e73e5a
Feat: Initial build of tailwind 4 plugin with separate node and brows…
jlukic Jun 11, 2025
dd9fafa
Feat: Attempt to integrate tailwind 4 into single package with browse…
jlukic Jun 11, 2025
9fc799e
Feat: tailwinds compiler mostly complete, have wasm working!
jlukic Jun 11, 2025
dea9956
Docs: do full tailwinds v4 demo
jlukic Jun 11, 2025
1486c08
Properly load tailwinds from source packages instead of inline testin…
jlukic Jun 11, 2025
a3e5c8f
Docs: simplify testing of optimize deps fixes
jlukic Jun 11, 2025
e86989d
Feat: Tailwind plugin clean up dev cruft, remove engine files that ar…
jlukic Jun 11, 2025
d9c0a5d
Test: Write basic tests including browser tests for tailwind plugin
jlukic Jun 12, 2025
4375964
Docs: modify tailwind example to use settings, page css, and SUI next…
jlukic Jun 12, 2025
0921ed2
chore: add readme and agents.md for tailwind package
jlukic Jun 12, 2025
b369189
Chore: Update release notes on tailwinds
jlukic Jun 12, 2025
acdfd21
Chore: typos in release notes
jlukic Jun 12, 2025
3dfc486
Chore: Missing feature in release notes
jlukic Jun 12, 2025
55f1c6a
Chore: Remove unused wasm files for linux. Relying on node package now
jlukic Jun 12, 2025
58db413
Chore: Package-lock, begin work on wasm loader fix for tailwind dist …
jlukic Jun 12, 2025
c47cb76
Feat: Add mutation observer to look for theme change
jlukic Jun 13, 2025
8b67a8c
Feat: Dark mode constant now also respects html class dark
jlukic Jun 13, 2025
944d6e6
Adds dark mode to tailwinds example
jlukic Jun 13, 2025
0bb815f
Refactor tailwinds to use separate package for compilation
jlukic Jun 13, 2025
c4088c7
Feat: Continue to refactor tailwindcss-iso as separate package
jlukic Jun 13, 2025
16bc92c
Feat: continue renaming of tailwind package exports
jlukic Jun 13, 2025
e144a8a
Bug: Various bug fixes while testing refactor of tailwind
jlukic Jun 13, 2025
020528b
Feat: finish plugin, add server/browser export conditions to tailwind…
jlukic Jun 13, 2025
5a2ecc7
Update readme and agents.md
jlukic Jun 13, 2025
d71cd18
Feat: Update types for tailwind packages
jlukic Jun 13, 2025
e6ecb31
Add tests
jlukic Jun 13, 2025
ac1a833
Feat: Update tailwindcss-iso test struct
jlukic Jun 13, 2025
a0d677e
Chore: package-lock
jlukic Jun 13, 2025
6bdac78
Chore: Move tailwindcss-iso to standalone repo and publish to npm
jlukic Jun 13, 2025
1f90c5b
Chore: migrate to ext package for tailwind-iso
jlukic Jun 13, 2025
47b5ea4
Test: remove wasm test in playwright for now
jlukic Jun 13, 2025
6db99eb
Chore: Vitest doesnt like missing test suite
jlukic Jun 13, 2025
4455570
Chore: Remove wasm browser tests entirely to make test runner happy
jlukic Jun 13, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ dist/
tests/results/
tests/test-case/dist

# for my ai friends
ai/meta/agent-guestbook.md

# Numerous always-ignore extensions
*.diff
*.err
Expand Down
22 changes: 22 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@ This is a pre-release version and APIs will change quickly. Before `1.0` release

Please note after `1.0` Semver will be followed using normal protocols.

# Version 0.12.0
* **Tailwind** - Added a plugin for using Tailwind inside Semantic UI components. This can be used alongside the css tokens provided by the css framework, or instead of it. This will scan your component javascript, html and css and attach only the tailwind styles used.

> Note: the plugin code may be modified if `defineComponent` gets a formal 'Plugin API'. For now you will need to pass in the component to the plugin before defining the component.


```javascript
import { TailwindPlugin } from '@semantic-ui/tailwind';
const tailwindPlugin = TailwindPlugin();


// Transform with Tailwind plugin
const definition = {
// your component definition
template: `<div class="p-4 bg-red-500"></div>`
}
defineComponent( await tailwindPlugin(definition) );

```

* **Template Compiler** - Fixed an issue with nested conditionals inside svg.

# Version 0.11.3
* **Input** - Fix placeholder focused color to be theme aware

Expand Down
2 changes: 1 addition & 1 deletion docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default defineConfig({
},
optimizeDeps: {
force: true,
exclude: ['playground-elements'],
exclude: ['playground-elements', 'tailwindcss-iso'],
},
},

Expand Down
1 change: 0 additions & 1 deletion docs/src/components/CodePlayground/CodePlayground.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ const createComponent = (
// and the right pane is just the iframe preview
if (filter && self.onlyPageFiles(fileArray)) {
if (filter == 'main') {
console.log(fileArray.filter(file => self.isPageFile(file.filename)));
return fileArray.filter(file => self.isPageFile(file.filename));
}
else if (filter == 'page') {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/examples/cdn.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'CDN'
exampleType: 'page'
category: 'UI Framework'
category: 'Components'
subcategory: 'Usage'
tags: ['component', 'usage']
description: An example of using the component framework from a cdn
Expand Down
9 changes: 9 additions & 0 deletions docs/src/content/examples/tailwind.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: 'Tailwind'
exampleType: 'component'
category: 'Components'
subcategory: 'Usage'
fold: false
tags: ['component', 'usage']
description: An example of using Tailwinds with web components
---
15 changes: 15 additions & 0 deletions docs/src/examples/tailwind/component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
Example using @theme inside a component

*/

@theme {
/* This changes the bluish grays to a monochrome color */
--color-gray-100: theme(colors.zinc.100);
--color-gray-300: theme(colors.zinc.300);
--color-gray-700: theme(colors.zinc.700);
--color-gray-950: theme(colors.zinc.950);
}

/* this allows us to add "dark" class to component to trigger dark mode */
@custom-variant dark (&:where(.dark, .dark *));
39 changes: 39 additions & 0 deletions docs/src/examples/tailwind/component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{#snippet bullet}
<li class="flex">
<svg class="h-6 w-6 flex-shrink-0" viewBox="0 0 22 22" fill="none" stroke-linecap="square">
<circle cx="11" cy="11" r="11" class="fill-sky-400 opacity-25" />
<circle cx="11" cy="11" r="10.5" class="stroke-sky-400 opacity-25" />
<path d="M8 11.5L10.5 14L14 8" class="stroke-sky-800 dark:stroke-sky-300" />
</svg>
<p class="ml-3">
{#html content}
</p>
</li>
{/snippet}

<div class="component {darkMode ? 'dark' : ''}">
<div class="relative grid min-h-screen grid-cols-[1fr_2.5rem_auto_2.5rem_1fr] grid-rows-[1fr_1px_auto_1px_1fr] bg-white [--pattern-fg:var(--color-gray-950)]/5 dark:bg-gray-950 dark:[--pattern-fg:var(--color-white)]/10">
<div class="col-start-3 row-start-3 flex max-w-lg flex-col bg-gray-100 p-2 dark:bg-white/10">
<div class="rounded-xl bg-white p-10 text-sm/7 text-gray-700 dark:bg-gray-950 dark:text-gray-300">
<img src="https://play.tailwindcss.com/img/logo.svg" class="mb-12 h-6 dark:hidden" alt="Tailwind Play" />
<img src="https://play.tailwindcss.com/img/logo-dark.svg" class="mb-12 h-6 hidden dark:block" alt="Tailwind Play" />
<div class="space-y-6">
<p>An advanced online playground for Tailwind CSS, including support for things like:</p>
<ul class="space-y-3">
{#each item in proofPoints}
{>bullet content=item}
{/each}
</ul>
<p>Perfect for learning how the framework works, prototyping a new idea, or creating a demo to share online.</p>
</div>
<hr class="my-6 w-full border-gray-200 dark:border-gray-700" />
<p class="mb-3">Want to dig deeper into Tailwind?</p>
<ui-button primary href="https://tailwindcss.com/docs" icon="open book">Read the docs</ui-button>
</div>
</div>
<div class="relative -right-px col-start-2 row-span-full row-start-1 border-x border-x-(--pattern-fg) bg-[image:repeating-linear-gradient(315deg,_var(--pattern-fg)_0,_var(--pattern-fg)_1px,_transparent_0,_transparent_50%)] bg-[size:10px_10px] bg-fixed"></div>
<div class="relative -left-px col-start-4 row-span-full row-start-1 border-x border-x-(--pattern-fg) bg-[image:repeating-linear-gradient(315deg,_var(--pattern-fg)_0,_var(--pattern-fg)_1px,_transparent_0,_transparent_50%)] bg-[size:10px_10px] bg-fixed"></div>
<div class="relative -bottom-px col-span-full col-start-1 row-start-2 h-px bg-(--pattern-fg)"></div>
<div class="relative -top-px col-span-full col-start-1 row-start-4 h-px bg-(--pattern-fg)"></div>
</div>
</div>
21 changes: 21 additions & 0 deletions docs/src/examples/tailwind/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineComponent, getText } from '@semantic-ui/component';
import { TailwindPlugin } from '@semantic-ui/tailwind';

const template = await getText('./component.html');
const css = await getText('./component.css');

const defaultSettings = {
proofPoints: [],
};

let definition = {
tagName: 'tailwind-demo',
template,
css,
defaultSettings,
};

// Transform with Tailwind plugin
definition = await TailwindPlugin(definition);

export const TailwindDemo = defineComponent(definition);
8 changes: 8 additions & 0 deletions docs/src/examples/tailwind/page.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
html {
/*
note tailwind base em size is 16px instead of semantic ui's 14px
this means to have everything sized the same as other tailwind projects
when using sui + tailwinds you will want to resize semantic components
*/
--font-size: 16px;
}
10 changes: 10 additions & 0 deletions docs/src/examples/tailwind/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { $ } from '@semantic-ui/query';

$('tailwind-demo').settings({
proofPoints: [
`Customizing your theme with <code>@theme</code>`,
`Adding custom utilities with <code>@utility</code>`,
`Adding custom variants with <code>@variant</code>`,
`Code completion with instant preview`,
],
});
8 changes: 5 additions & 3 deletions docs/src/pages/examples/importmap.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const npmPackages = [
'@semantic-ui/renderer',
'@semantic-ui/query',
'@semantic-ui/specs',
'@semantic-ui/tailwind',
'@semantic-ui/utils',
];

Expand All @@ -26,6 +27,7 @@ export const localPackages = [
'@semantic-ui/core/packages/specs',
'@semantic-ui/core/packages/utils',
'@semantic-ui/core/packages/reactivity',
'@semantic-ui/core/packages/tailwind',
];

// note NPM packages is no longer used for static builds
Expand All @@ -39,11 +41,10 @@ const packageImports = { imports: {} };

for (const pkg of importPackages) {
try {

// use jsdelivr
if(isStaticBuild) {
if (isStaticBuild) {
let url = `${packageBase}/${pkg}/`;
if(packageBase.includes('jsdelivr')) {
if (packageBase.includes('jsdelivr')) {
url += '+esm';
}
packageImports.imports[pkg] = url;
Expand Down Expand Up @@ -88,6 +89,7 @@ export const importMap = packageImports;
export const importMapJSON = JSON.stringify(packageImports, null, 2);

export const GET = async () => {
console.log(importMapJSON);
return new Response(importMapJSON, {
headers: {
'Content-Type': 'application/importmap+json',
Expand Down
1 change: 0 additions & 1 deletion docs/src/pages/examples/package.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const packageFile = {
};

export const packageJSON = JSON.stringify(packageFile, null, 2);

export const GET = async () => {
return new Response(packageJSON, {
headers: {
Expand Down
4 changes: 2 additions & 2 deletions internal-packages/esbuild-callback/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Jack Lukic
Copyright (c) 2025 Jack Lukic

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
2 changes: 1 addition & 1 deletion internal-packages/esbuild-resolve-bare-imports/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2024 Jack Lukic
Copyright (c) 2025 Jack Lukic

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

Expand Down
3 changes: 3 additions & 0 deletions internal-packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@
"@semantic-ui/specs": "^0.11.2",
"esbuild": "^0.25.1",
"tiny-glob": "^0.2.9"
},
"devDependencies": {
"@chialab/esbuild-plugin-worker": "^0.18.1"
}
}
13 changes: 6 additions & 7 deletions internal-packages/scripts/src/lib/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// package is package.json
export const getBanner = (packageFile) => `/**
export const getBanner = (packageFile) =>
`/**
* ${packageFile.name} v${packageFile.version}
* ${packageFile.description || ''}
*
Expand All @@ -11,19 +12,17 @@ export const getBanner = (packageFile) => `/**
* LICENSE file in the root directory of this source tree.
*/`;


// This is used for files build internally to concatenate css (see build-ui-deps.js)
export const INTERNAL_CSS_BANNER = `/**
export const INTERNAL_CSS_BANNER = `/**
---DO NOT EDIT THIS FILE DIRECTLY---
This CSS file was concatenated from files listed in the css/ folder as part of a build process
This is to allow for js import with @import links which will not be followed
**/
`
`;

export const TARGET_BROWSERS = ['chrome80', 'edge80', 'firefox78', 'safari14', 'ios14', 'opera67'];
export const TARGET_BROWSERS = ['chrome80', 'edge80', 'firefox78', 'safari14', 'ios14', 'opera67'];

export const JS_BUILD_CONFIG = {

// target browser by default for dist
target: TARGET_BROWSERS,

Expand All @@ -40,6 +39,7 @@ export const JS_BUILD_CONFIG = {
'.ts': 'ts',
'.html': 'text',
'.css': 'text',
'.wasm': 'file',
'.png': 'file',
'.svg': 'file',
'.jpg': 'file',
Expand All @@ -49,7 +49,6 @@ export const JS_BUILD_CONFIG = {
};

export const CSS_BUILD_CONFIG = {

// target browser by default for dist
target: TARGET_BROWSERS,

Expand Down
Loading