mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
0edc66da49
Relates to #5389
20 lines
417 B
TypeScript
20 lines
417 B
TypeScript
import { useEffect } from 'react';
|
|
|
|
const useItemCss = (itemCss: string) => {
|
|
useEffect(() => {
|
|
const element = document.createElement('style');
|
|
element.setAttribute('type', 'text/css');
|
|
element.appendChild(document.createTextNode(`
|
|
.note-list-item {
|
|
${itemCss};
|
|
}
|
|
`));
|
|
document.head.appendChild(element);
|
|
return () => {
|
|
element.remove();
|
|
};
|
|
}, [itemCss]);
|
|
};
|
|
|
|
export default useItemCss;
|