File tree Expand file tree Collapse file tree 5 files changed +37
-1
lines changed Expand file tree Collapse file tree 5 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,16 @@ describe("Bleed", () => {
24
24
await bunmatch ( render ( Bleed , props ) , ReactBleed , {
25
25
props,
26
26
children : [ React . createElement ( "span" , { } , "Bleed body" ) ] ,
27
+ opts : {
28
+ alterAttrValue ( name , value ) {
29
+ // TODO: This is to support darkside styles
30
+ if ( name === "style" ) {
31
+ const reg = / - - _ _ a x [ ^ ; ] + ; / g;
32
+ return value . replaceAll ( reg , "" ) ;
33
+ }
34
+ return value ;
35
+ } ,
36
+ } ,
27
37
} ) ,
28
38
) . toBeTrue ( ) ;
29
39
} ) ;
Original file line number Diff line number Diff line change @@ -29,6 +29,16 @@ describe("Box", () => {
29
29
await bunmatch ( render ( Box , props ) , ReactBox , {
30
30
props,
31
31
children : [ React . createElement ( "span" , { } , "Box body" ) ] ,
32
+ opts : {
33
+ alterAttrValue ( name , value ) {
34
+ // TODO: This is to support darkside styles
35
+ if ( name === "style" ) {
36
+ const reg = / - - _ _ a x [ ^ ; ] + ; / g;
37
+ return value . replaceAll ( reg , "" ) ;
38
+ }
39
+ return value ;
40
+ } ,
41
+ } ,
32
42
} ) ,
33
43
) . toBeTrue ( ) ;
34
44
} ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,16 @@ describe("HGrid", () => {
21
21
React . createElement ( "div" , { key : "1" } ) ,
22
22
React . createElement ( "div" , { key : "2" } ) ,
23
23
] ,
24
+ opts : {
25
+ alterAttrValue ( name , value ) {
26
+ // TODO: This is to support darkside styles
27
+ if ( name === "style" ) {
28
+ const reg = / - - _ _ a x [ ^ ; ] + ; / g;
29
+ return value . replaceAll ( reg , "" ) ;
30
+ }
31
+ return value ;
32
+ } ,
33
+ } ,
24
34
} ) ,
25
35
) . toBeTrue ( ) ;
26
36
} ) ;
Original file line number Diff line number Diff line change 9
9
import Tag from " $lib/components/Tag/Tag.svelte" ;
10
10
import type { Snippet } from " svelte" ;
11
11
import " ../doclib/styles.css" ;
12
- import " ../lib/css/darkside .css" ;
12
+ import " ../lib/css/index .css" ;
13
13
import type { LayoutData } from " ./$types" ;
14
14
15
15
let { data, children }: { data: LayoutData ; children: Snippet } = $props ();
Original file line number Diff line number Diff line change @@ -22,3 +22,9 @@ If you want unstyled `a`, you can add the class `unstyled` to prevent this styli
22
22
If you want to use Tailwind, follow the [official guide to configure SvelteKit with Tailwind](https://tailwindcss.com/docs/guides/sveltekit).
23
23
24
24
Although, you might not need to add `@tailwind base;` and `@tailwind components;` to your `.css` file.
25
+
26
+ ## Darkside
27
+
28
+ To preview darkside, import `@nais/ds-svelte-community/css/darkside.css` instead of `@nais/ds-svelte-community/css`.
29
+
30
+ Add `navds-theme` as a class to your `body` element, and optionally the `dark` class.
You can’t perform that action at this time.
0 commit comments