Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions packages/docs/src/repl/ui/monaco.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { getColorPreference } from '../../components/theme-toggle/theme-toggle';
import { bundled, getDeps, getNpmCdnUrl } from '../bundler/bundled';
import { isServer } from '@builder.io/qwik';
import { QWIK_PKG_NAME_V1, QWIK_PKG_NAME_V2 } from '../repl-constants';
import cssTypes from '../../../../qwik/node_modules/csstype/index.d.ts?raw';

export const initMonacoEditor = async (
containerElm: any,
Expand Down Expand Up @@ -213,6 +214,7 @@ export const addQwikLibs = async (version: string) => {
'/node_modules/@builder.io/qwik/dist/jsx-runtime.d.ts'
);
typescriptDefaults.addExtraLib(CLIENT_LIB);
typescriptDefaults.addExtraLib(cssTypes, '/node_modules/csstype/index.d.ts');
};

const loadDeps = async (pkgVersion: string) => {
Expand Down
26 changes: 21 additions & 5 deletions packages/qwik/src/core/render/jsx/types/jsx-types.unit.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { assertType, describe, expectTypeOf, test } from 'vitest';
import { component$, type PropsOf, type PublicProps } from '../../../component/component.public';
import { $, type PropFunction } from '../../../qrl/qrl.public';
import type { EventHandler, QRLEventHandlerMulti } from './jsx-qwik-attributes';
import type { JSX } from '../jsx-runtime';
import type { QwikHTMLElements, QwikSVGElements, Size } from './jsx-generated';
import type { FunctionComponent, JSXOutput } from './jsx-node';
import type { EventHandler, JSXChildren, QRLEventHandlerMulti } from './jsx-qwik-attributes';
import type { QwikIntrinsicElements } from './jsx-qwik-elements';
import type { JSXChildren } from './jsx-qwik-attributes';
import { component$, type PropsOf, type PublicProps } from '../../../component/component.public';
import type { QwikHTMLElements, QwikSVGElements, Size } from './jsx-generated';
import type { JSX } from '../jsx-runtime';

describe('types', () => {
// Note, these type checks happen at compile time. We don't need to call anything, so we do ()=>()=>. We just need to
Expand Down Expand Up @@ -327,4 +326,21 @@ describe('types', () => {

expectTypeOf<PropsOf<17>>().toEqualTypeOf<never>();
});

test('CSSProperties', () => () => {
return (
<div
style={{
color: 'red',
backgroundColor: 'blue',
// Using a CSS variable
'--my-variable': '10px',
// Using a number value
marginTop: 10,
// Using a string value
padding: '5px',
}}
/>
);
});
});