import { component$, useStyles$, useStore } from '@qwik.dev/core';
export default component$(() => {
useStyles$(AppCSS);
const store = useStore({ open: false, siblings: [0] }, { deep: true });
return (
{store.open ? : null}
{store.siblings.map(() => (
))}
);
});
export const Child = component$(() => {
useStyles$(ChildCSS);
return (
);
});
export const Sibling = component$(() => {
useStyles$(SiblingCSS);
return (
);
});
//TODO: These should be import as: import AppCSS from './app.css';
// however the playground does not yet support such imports.
export const AppCSS = `
.parent {
border: 1px solid black;
padding: 1em;
}
`;
export const ChildCSS = `
.child {
margin-top: 1em;
border: 1px solid red;
padding: 1em;
display: block;
}
`;
export const SiblingCSS = `.sibling {
margin-top: 1em;
border: 1px solid green;
padding: 1em;
display: block;
}
`;