Skip to content

Commit 8ad8e79

Browse files
committed
[FIX] GlobalCSS styling for Modals/Drawers
1 parent e475ed4 commit 8ad8e79

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

client/packages/lowcoder-core/lib/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3235,7 +3235,6 @@ function styleNamespace(id) {
32353235
function evalStyle(id, css, globalStyle) {
32363236
const styleId = styleNamespace(id);
32373237
const prefixId = globalStyle ? id : `.${id}`;
3238-
console.log(prefixId);
32393238
let compiledCSS = "";
32403239
css.forEach((i) => {
32413240
if (!i.trim()) {
@@ -3252,7 +3251,6 @@ function evalStyle(id, css, globalStyle) {
32523251
document.querySelector("head")?.appendChild(styleNode);
32533252
}
32543253
styleNode.textContent = compiledCSS;
3255-
console.log("style", styleNode.textContent);
32563254
}
32573255
function clearStyleEval(id) {
32583256
const styleId = id && styleNamespace(id);

client/packages/lowcoder-core/src/eval/utils/evalStyle.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ function styleNamespace(id: string) {
66

77
export function evalStyle(id: string, css: string[], globalStyle?: boolean) {
88
const styleId = styleNamespace(id);
9-
const prefixId = globalStyle ? id : `.${id}`
10-
console.log(prefixId)
9+
const prefixId = globalStyle ? id : `.${id}`;
1110
let compiledCSS = "";
1211
css.forEach((i) => {
1312
if (!i.trim()) {
@@ -25,7 +24,6 @@ export function evalStyle(id: string, css: string[], globalStyle?: boolean) {
2524
document.querySelector("head")?.appendChild(styleNode);
2625
}
2726
styleNode.textContent = compiledCSS;
28-
console.log("style",styleNode.textContent)
2927
}
3028

3129
export function clearStyleEval(id?: string) {

client/packages/lowcoder/src/comps/hooks/drawerComp.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import { isNumeric } from "util/stringUtils";
2626
import { NameConfig, withExposingConfigs } from "../generators/withExposing";
2727
import { title } from "process";
2828
import { SliderControl } from "../controls/sliderControl";
29+
import clsx from "clsx";
30+
import { useApplicationId } from "util/hooks";
2931

3032
const EventOptions = [closeEvent] as const;
3133

@@ -119,6 +121,7 @@ let TmpDrawerComp = (function () {
119121
const isTopBom = ["top", "bottom"].includes(props.placement);
120122
const { items, ...otherContainerProps } = props.container;
121123
const userViewMode = useUserViewMode();
124+
const appID = useApplicationId();
122125
const resizable = !userViewMode && (!isTopBom || !props.autoHeight);
123126
const onResizeStop = useCallback(
124127
(
@@ -172,7 +175,7 @@ let TmpDrawerComp = (function () {
172175
zIndex={Layers.drawer}
173176
maskClosable={props.maskClosable}
174177
mask={props.showMask}
175-
className={props.className as string}
178+
className={clsx(`app-${appID}`, props.className)}
176179
data-testid={props.dataTestId as string}
177180
>
178181
{props.toggleClose && (

client/packages/lowcoder/src/comps/hooks/modalComp.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ let TmpModalComp = (function () {
116116
(props, dispatch) => {
117117
const userViewMode = useUserViewMode();
118118
const appID = useApplicationId();
119-
console.log("APP", appID);
120119
const bodyStyle: CSSProperties = { padding: 0 };
121120
const width = transToPxSize(props.width || DEFAULT_WIDTH);
122121
let height = undefined;

0 commit comments

Comments
 (0)