Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanatkn committed Oct 8, 2024
1 parent 8d747d8 commit c896267
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/lib/css_class_helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const values: Array<[contents: string, expected: string[]]> = [
['class:a', ['a']],
['class:a ', ['a']],
['class:a=', ['a']],
['class:a>', ['a']],
// `classes=` prop
['classes="a"', ['a']],
['classes="a b"', ['a', 'b']],
Expand Down
2 changes: 1 addition & 1 deletion src/lib/css_class_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface Css_Extractor {
const CSS_CLASS_EXTRACTORS: Css_Extractor[] = [
// `class:a`
{
matcher: /(?<!['"`])class:([^\s=]+)/gi,
matcher: /(?<!['"`])class:([^\s=>]+)/gi,
mapper: (matched) => [matched[1]],
}, // initial capture group is fake just because the second regexp uses a capture group for its back reference

Expand Down
4 changes: 2 additions & 2 deletions src/lib/styles.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {test} from 'uvu';
import * as assert from 'uvu/assert';

import styles from '$lib/styles.css?raw';
import main_stylesheet from '$lib/style.css?raw';
import * as exported_variables from '$lib/variables.js';

// TODO BLOCK generate all styles here? only in memory? // style_animations, style_components,

Check warning on line 7 in src/lib/styles.test.ts

View workflow job for this annotation

GitHub Actions / build (20.17)

Unexpected 'todo block' comment: 'TODO BLOCK generate all styles here?...'
const css_files = [styles];
const css_files = [main_stylesheet];

const extract_custom_properties = (css: string) =>
Array.from(css.matchAll(/--([a-z][a-z0-9_]*(?<!_))/g)).map((m) => m[1]);
Expand Down

0 comments on commit c896267

Please sign in to comment.