From f621fbb224709288904b021570e65f42891d6391 Mon Sep 17 00:00:00 2001 From: Joe Marquardt <82404108+dotjoe@users.noreply.github.com> Date: Mon, 14 Jul 2025 15:13:11 -0500 Subject: [PATCH 1/3] fix the build on windows (#1148) - make-react importPath variable - esbuild entryPoints globby usage requires forward slashes --- packages/webawesome/scripts/build.js | 8 ++++---- packages/webawesome/scripts/make-react.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/webawesome/scripts/build.js b/packages/webawesome/scripts/build.js index ac300ccd6..5ef2acec0 100644 --- a/packages/webawesome/scripts/build.js +++ b/packages/webawesome/scripts/build.js @@ -8,7 +8,7 @@ import { replace } from 'esbuild-plugin-replace'; import { mkdir, readFile } from 'fs/promises'; import getPort, { portNumbers } from 'get-port'; import { globby } from 'globby'; -import { dirname, join, relative } from 'node:path'; +import { dirname, join, posix, relative } from 'node:path'; import process from 'node:process'; import { fileURLToPath } from 'node:url'; import ora from 'ora'; @@ -186,11 +186,11 @@ export async function build(options = {}) { join(rootDir, 'src/webawesome.loader.ts'), join(rootDir, 'src/webawesome.ssr-loader.ts'), // Individual components - ...(await globby(join(rootDir, 'src/components/**/!(*.(style|test)).ts'))), + ...(await globby(posix.join(rootDir, 'src/components/**/!(*.(style|test)).ts'))), // Translations - ...(await globby(join(rootDir, 'src/translations/**/*.ts'))), + ...(await globby(posix.join(rootDir, 'src/translations/**/*.ts'))), // React wrappers - ...(await globby(join(rootDir, 'src/react/**/*.ts'))), + ...(await globby(posix.join(rootDir, 'src/react/**/*.ts'))), ], outdir: getCdnDir(), chunkNames: 'chunks/[name].[hash]', diff --git a/packages/webawesome/scripts/make-react.js b/packages/webawesome/scripts/make-react.js index 402e46295..72d135112 100644 --- a/packages/webawesome/scripts/make-react.js +++ b/packages/webawesome/scripts/make-react.js @@ -25,7 +25,7 @@ for await (const component of components) { const tagWithoutPrefix = component.tagName.replace(/^wa-/, ''); const componentDir = path.join(reactDir, tagWithoutPrefix); const componentFile = path.join(componentDir, 'index.ts'); - const importPath = path.relative(srcDir, component.path); + const importPath = path.posix.relative(srcDir, component.path); // We only want to wrap wa- prefixed events, because the others are native const eventsToWrap = component.events?.filter(event => event.name.startsWith('wa-')) || []; From 5b544102126134e2af9c38ed3bf40292959a79b7 Mon Sep 17 00:00:00 2001 From: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com> Date: Mon, 14 Jul 2025 16:21:15 -0400 Subject: [PATCH 2/3] Revise native styles documentation (#1153) --- .../webawesome/docs/assets/styles/docs.css | 9 +- .../webawesome/docs/docs/utilities/native.md | 627 +++++++++--------- packages/webawesome/src/styles/native.css | 14 +- 3 files changed, 317 insertions(+), 333 deletions(-) diff --git a/packages/webawesome/docs/assets/styles/docs.css b/packages/webawesome/docs/assets/styles/docs.css index ba413cb2c..8489f562e 100644 --- a/packages/webawesome/docs/assets/styles/docs.css +++ b/packages/webawesome/docs/assets/styles/docs.css @@ -144,8 +144,8 @@ wa-page > header { border-inline-start: var(--wa-border-width-s) solid var(--wa-color-surface-border); font-size: var(--wa-font-size-s); line-height: var(--wa-line-height-condensed); - margin: 0; padding-inline-start: var(--wa-space-m); + margin: 0; } ul ul { @@ -158,6 +158,7 @@ wa-page > header { li { list-style: none; + margin: 0; + li { margin-block-start: var(--wa-space-m); @@ -620,12 +621,6 @@ table.colors { min-inline-size: 8rem; } -/* Utilities */ -.two-columns { - columns: 2; - gap: 1rem; -} - /* Component API tables */ wa-scroller:has(.component-table) { margin-block-end: var(--wa-space-xl); diff --git a/packages/webawesome/docs/docs/utilities/native.md b/packages/webawesome/docs/docs/utilities/native.md index 1d9ee27ba..6d0759dfc 100644 --- a/packages/webawesome/docs/docs/utilities/native.md +++ b/packages/webawesome/docs/docs/utilities/native.md @@ -5,27 +5,52 @@ layout: page-outline tags: styleUtilities --- -Web Awesome provides optional Native Styles that make native HTML elements look good so you can continue using what you know and gradually adopt Web Awesome as you see fit. +Native styles use design tokens to spruce up native HTML elements so that they match the look and feel of your theme. While these native styles are completely optional, they're a great starting point for a cohesive design and a huge help when using a combination of native elements and Web Awesome components in your project. -## Installation +## Using native styles -To use all Web Awesome page styles (including [utilities](/docs/utilities/)), include the following stylesheet in your project: +To use all Web Awesome styles (including [utilities](/docs/utilities/)), include the following stylesheet in your project: ```html ``` -Or, to _only_ include styles for native elements: +Or, if you only want styles for native elements, include the default theme and native styles individually: ```html + ``` -## Elements +You can additionally include any pre-made [theme](/docs/themes/) or [color palette](/docs/color-palettes/) to change the look of native elements. + +## Content flow + +Native styles set default space between many block-level HTML elements using the `--wa-content-spacing` token from your theme. This helps ensure that your content is readable. + +```html {.example} +
Fusce mollis quam lorem, et gravida arcu laoreet ut. Pellentesque et malesuada mi. Morbi faucibus nisl nec nulla porta, ac scelerisque elit finibus.
+The Road goes ever on and on+
+Out from the door where it began.
Donec varius, ipsum sit amet lobortis tristique, quam arcu pellentesque turpis, non porta lacus arcu non arcu. Morbi luctus at nisl sit amet faucibus.
+`. Paragraphs inherit the default text styles set on the `
` element and use `text-wrap: pretty` to prevent orphaned lines in supported browsers. ```html {.example}@@ -55,7 +80,7 @@ Standard paragraph text with optimal spacing and readability. ### Blockquotes -Styled quotations that stand out from regular text. +Emphasize longer quotations with `
`. Block quotes use your theme's serif font family and a leading border to stand out. ```html {.example}@@ -67,51 +92,51 @@ Styled quotations that stand out from regular text. ### Lists -Organized content in bulleted or numbered format with proper nesting support. +Create ordered and unordered lists with `` and `
`, plus `
- ` for list items within. ```html {.example} -
-
+- List item 1
-- - List item 2 -
--
-- Subitem a
-- Subitem b
-- List item 3
-+``` -### Description Lists - -Term and definition pairs for glossaries and descriptions. +Use `+
-- First item
+- + Another item +
++
+- Nested item
+- Another nested item
+- Final item
+-
+- List item 1
-- - List item 2 -
--
-- Subitem a
-- Subitem b
-- List item 3
-+
+- First item
+- + Another item +
++
+- Nested item
+- Another nested item
+- Final item
+` to create lists of terms (`
- `) and definitions (`
- `). ```html {.example}
-
``` +### Code blocks + +Create code blocks or other preformatted text with `- Definition 1
+- First term
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-- Definition 2
+- Second term
- Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-- Definition 3
+- Final term
- Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. @@ -119,13 +144,153 @@ Term and definition pairs for glossaries and descriptions.
`. Preformatted text uses your theme's monospace font family and a subtle background color. + +```html {.example} ++// do a thing +export function thing() { + return true; +} ++``` + +### Inline text + +Use any inline text element like ``, ``, ``, ``, and others to stylize or emphasize text. + +```html {.example} +++``` + +## Widgets & media + +### Media + +Add responsive media with `+ Bold + Italic + Underline ++ +Strike-through+Deleted+ Inserted + Small +`, `