Skip to content
Open
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
1 change: 1 addition & 0 deletions packages/cmsui/news/8012.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Separate public UI and CMS UI styles. @arybakov05
7 changes: 7 additions & 0 deletions packages/cmsui/routes/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { shouldShowToolbar } from '@plone/layout/helpers';
import Sidebar, { sidebarAtom } from '../components/Sidebar/Sidebar';
import Settings from '@plone/components/icons/settings.svg?react';
import { useAtom } from 'jotai';
import { useLayoutEffect } from 'react';
import { clsx } from 'clsx';
import config from '@plone/registry';

Expand Down Expand Up @@ -73,6 +74,12 @@ export default function Index() {
const navigate = useNavigate();
const [collapsed, setCollapsed] = useAtom(sidebarAtom);

useLayoutEffect(() => {
document
.querySelectorAll('link[href*="publicui.css"]')
.forEach((el) => el.remove());
}, []);

if (!rootData) {
return null;
}
Expand Down
11 changes: 6 additions & 5 deletions packages/cmsui/styles/cmsui.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

@source '../node_modules/@plone/components/dist/quanta';

@import 'tailwindcss/theme.css' layer(theme);
@import 'tailwindcss/preflight.css' layer(base);
@import 'tailwindcss/utilities.css' layer(utilities);

@custom-variant dark (&:where(.dark, .dark *));

@layer cmsui {
@import '@plone/components/src/styles/basic/theme.css';
@import 'tailwindcss/theme.css';
@import 'tailwindcss/preflight.css';
@import 'tailwindcss/utilities.css';

:root {
body.cmsui {
--background: hsl(0 0% 100%);
--foreground: hsl(222.2 84% 4.9%);
--card: hsl(0 0% 100%);
Expand Down Expand Up @@ -40,7 +41,7 @@
/* --radius: 0.6rem; */
}

.dark {
body.cmsui.dark {
--background: hsl(222.2 84% 4.9%);
--foreground: hsl(210 40% 98%);
--card: hsl(222.2 84% 4.9%);
Expand Down
1 change: 1 addition & 0 deletions packages/publicui/news/8012.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Separate public UI and CMS UI styles. @arybakov05
7 changes: 7 additions & 0 deletions packages/publicui/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
type LinksFunction,
type MetaFunction,
} from 'react-router';
import { useLayoutEffect } from 'react';
import { useTranslation } from 'react-i18next';
import {
Link,
Expand Down Expand Up @@ -86,6 +87,12 @@ export default function Index() {
.filter((match) => match.handle?.bodyClass)
.map((match) => match.handle?.bodyClass);

useLayoutEffect(() => {
document
.querySelectorAll('link[href*="cmsui.css"]')
.forEach((el) => el.remove());
}, []);

if (!rootData) {
return null;
}
Expand Down
Loading