Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): wrong style of mindmap in dark mode #9462

Merged
merged 1 commit into from
Dec 31, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function drawGeneralShape(
ctx.shadowOffsetY = offsetY * scale;
}

ctx.shadowColor = renderer.getPropertyValue(color);
ctx.shadowColor = renderer.getColorValue(color, undefined, true);
}

ctx.stroke();
Expand Down
35 changes: 18 additions & 17 deletions blocksuite/affine/model/src/elements/mindmap/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type NodeStyle = {
blur: number;
offsetX: number;
offsetY: number;
color: string;
color: Color;
};
};

Expand Down Expand Up @@ -199,7 +199,7 @@ export class StyleTwo extends MindmapStyleGetter {
textResizing: TextResizing.AUTO_WIDTH_AND_HEIGHT,

strokeWidth: 3,
strokeColor: DefaultTheme.pureBlack,
strokeColor: DefaultTheme.black,

fontFamily: FontFamily.Poppins,
fontSize: 18,
Expand All @@ -215,7 +215,7 @@ export class StyleTwo extends MindmapStyleGetter {
blur: 0,
offsetX: 3,
offsetY: 3,
color: DefaultTheme.pureBlack,
color: DefaultTheme.black,
},
};

Expand All @@ -231,7 +231,7 @@ export class StyleTwo extends MindmapStyleGetter {
return {
connector: {
strokeStyle: StrokeStyle.Solid,
stroke: DefaultTheme.pureBlack,
stroke: DefaultTheme.black,
strokeWidth: 3,

mode: ConnectorMode.Orthogonal,
Expand All @@ -242,9 +242,9 @@ export class StyleTwo extends MindmapStyleGetter {
radius: 0.5,

filled: true,
fillColor: DefaultTheme.pureWhite,
fillColor: DefaultTheme.white,

strokeColor: DefaultTheme.pureBlack,
strokeColor: DefaultTheme.black,
strokeWidth: 3,
},
expandButton: {
Expand All @@ -253,14 +253,14 @@ export class StyleTwo extends MindmapStyleGetter {
radius: 2,

filled: true,
fillColor: DefaultTheme.pureBlack,
fillColor: DefaultTheme.black,

padding: [4, 0],

strokeColor: DefaultTheme.pureBlack,
strokeColor: DefaultTheme.black,
strokeWidth: 0,

color: DefaultTheme.pureWhite,
color: DefaultTheme.white,

fontFamily: FontFamily.Inter,
fontWeight: FontWeight.Bold,
Expand All @@ -272,7 +272,7 @@ export class StyleTwo extends MindmapStyleGetter {
textResizing: TextResizing.AUTO_WIDTH_AND_HEIGHT,

strokeWidth: 3,
strokeColor: DefaultTheme.pureBlack,
strokeColor: DefaultTheme.black,

fontFamily: FontFamily.Poppins,
fontSize: 16,
Expand All @@ -288,7 +288,7 @@ export class StyleTwo extends MindmapStyleGetter {
blur: 0,
offsetX: 3,
offsetY: 3,
color: DefaultTheme.pureBlack,
color: DefaultTheme.black,
},
},
};
Expand All @@ -300,7 +300,7 @@ export class StyleThree extends MindmapStyleGetter {
private readonly _strokeColor = [
DefaultTheme.StrokeColorMap.Yellow,
DefaultTheme.StrokeColorMap.Green,
DefaultTheme.StrokeColorMap.Teal,
'#5cc7ba',
];

readonly root = {
Expand Down Expand Up @@ -335,6 +335,7 @@ export class StyleThree extends MindmapStyleGetter {

override getNodeStyle(_: MindmapNode, path: number[]) {
const strokeColor = this._getColor(path.length - 2);
const dotColor = this._getColor(path.length - 1);

return {
node: {
Expand All @@ -343,7 +344,7 @@ export class StyleThree extends MindmapStyleGetter {
textResizing: TextResizing.AUTO_WIDTH_AND_HEIGHT,

strokeWidth: 2,
strokeColor: strokeColor,
strokeColor,

fontFamily: FontFamily.Poppins,
fontSize: 16,
Expand All @@ -370,7 +371,7 @@ export class StyleThree extends MindmapStyleGetter {
filled: true,
fillColor: DefaultTheme.pureWhite,

strokeColor: '#3cbc36',
strokeColor: dotColor,
strokeWidth: 3,
},
expandButton: {
Expand All @@ -379,14 +380,14 @@ export class StyleThree extends MindmapStyleGetter {
radius: 8,

filled: true,
fillColor: '#3cbc36',
fillColor: dotColor,

padding: [4, 0],

strokeColor: '#3cbc36',
strokeColor: dotColor,
strokeWidth: 0,

color: '#fff',
color: DefaultTheme.pureWhite,

fontFamily: FontFamily.Inter,
fontWeight: FontWeight.Bold,
Expand Down
4 changes: 2 additions & 2 deletions blocksuite/affine/model/src/elements/shape/shape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class ShapeElementModel extends GfxPrimitiveElementModel<ShapeProps> {
blur: number;
offsetX: number;
offsetY: number;
color: string;
color: Color;
} | null = null;

@field()
Expand Down Expand Up @@ -234,7 +234,7 @@ export class LocalShapeElementModel extends GfxLocalElementModel {
blur: number;
offsetX: number;
offsetY: number;
color: string;
color: Color;
} | null = null;

@prop()
Expand Down
Loading