Files
how2ice 005cf56baf
Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
init project
2025-12-12 14:26:25 +09:00

35 lines
614 B
JavaScript

import * as React from 'react';
import { styled } from '@mui/material/styles';
const Child = styled('div', {
target: 'child', // simulate a class name from @emotion/babel-plugin
})({
color: 'blue',
});
const Parent = styled('div')`
${Child} {
color: red;
}
`;
const Parent2 = styled('div')({
[Child]: {
color: 'red',
},
});
export default function ComponentSelector() {
return (
<div>
<Child>I am blue.</Child>
<Parent>
<Child>I am red (literal).</Child>
</Parent>
<Parent2>
<Child>I am red (object).</Child>
</Parent2>
</div>
);
}