Skip to content

Commit 3adffe5

Browse files
authored
Merge pull request #79 from ut-code/change-blockly-toolbox-styles
ツールボックスのスタイルを調整
2 parents 8f0947e + d3ef25f commit 3adffe5

3 files changed

Lines changed: 76 additions & 41 deletions

File tree

packages/web/src/main.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { createTheme, ThemeProvider } from "@mui/material";
12
import React from "react";
23
import ReactDOM from "react-dom/client";
34
import { createBrowserRouter, RouterProvider } from "react-router-dom";
@@ -15,8 +16,16 @@ const router = createBrowserRouter([
1516
},
1617
]);
1718

19+
const theme = createTheme({
20+
components: {
21+
MuiAppBar: { defaultProps: { elevation: 0, variant: "outlined" } },
22+
},
23+
});
24+
1825
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
1926
<React.StrictMode>
20-
<RouterProvider router={router} />
27+
<ThemeProvider theme={theme}>
28+
<RouterProvider router={router} />
29+
</ThemeProvider>
2130
</React.StrictMode>
2231
);

packages/web/src/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ const options: any = {
317317
zoom: {
318318
controls: true,
319319
},
320+
renderer: "thrasos",
320321
};
321322

322323
export default options;

packages/web/src/style.css

Lines changed: 65 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,74 @@
1-
html, body, #root {
1+
html,
2+
body,
3+
#root {
24
height: 100%;
35
}
46

57
body {
68
margin: 0px;
79
}
810

9-
/* ut-code/school-festival/src/grobal.css */
10-
html {
11+
:root {
12+
--divider-color: #ddd;
1113
overflow: hidden;
1214
}
13-
14-
html, body, #root {
15-
width: 100%;
16-
height: 100%;
17-
}
18-
19-
.blocklyPath {
20-
stroke: #444444 !important;
21-
}
22-
.blocklySelected .blocklyPath {
23-
stroke-width: inherit !important;
24-
stroke: #000000 !important;
25-
}
26-
.blocklyText {
27-
fill: #222 !important;
28-
}
29-
.blocklySelected .blocklyText {
30-
fill: #000 !important;
31-
}
32-
.blocklyFieldRect {
33-
fill: #fff !important;
34-
fill-opacity: 1 !important;
35-
}
36-
.blocklyDropDownDiv {
37-
border: 1px solid #aaa;
38-
}
39-
.blocklyDropDownDiv .blocklyDropDownArrow {
40-
border-top: 1px solid #aaa;
41-
border-left: 1px solid #aaa;
42-
}
43-
.blocklyFlyout {
44-
border-right: 1px solid #ddd;
45-
background-color: #fff;
46-
}
47-
.blocklyFlyoutBackground {
48-
fill: transparent;
49-
}
15+
16+
html,
17+
body,
18+
#root {
19+
width: 100%;
20+
height: 100%;
21+
}
22+
23+
.blocklyPath {
24+
stroke: #444 !important;
25+
}
26+
.blocklySelected .blocklyPath {
27+
stroke-width: inherit !important;
28+
stroke: #000 !important;
29+
}
30+
.blocklyText {
31+
fill: #222 !important;
32+
}
33+
.blocklySelected .blocklyText {
34+
fill: #000 !important;
35+
}
36+
.blocklyFieldRect {
37+
fill: #fff !important;
38+
fill-opacity: 1 !important;
39+
}
40+
.blocklyDropDownDiv {
41+
border: 1px solid var(--divider-color);
42+
}
43+
.blocklyDropDownDiv .blocklyDropDownArrow {
44+
border-top: 1px solid var(--divider-color);
45+
border-left: 1px solid var(--divider-color);
46+
}
47+
.blocklyToolboxDiv {
48+
background-color: #fff;
49+
border-right: 1px solid var(--divider-color);
50+
width: 120px;
51+
}
52+
.blocklyTreeRow {
53+
margin: 0;
54+
padding: 8px 12px !important;
55+
}
56+
.blocklyTreeRow:not(.blocklyTreeSelected):hover {
57+
background-color: #eee;
58+
}
59+
.blocklyTreeRow.blocklyTreeSelected {
60+
background-color: #ddd !important;
61+
}
62+
.blocklyTreeSelected .blocklyTreeLabel {
63+
color: inherit;
64+
}
65+
.blocklyFlyout {
66+
border-right: 1px solid #ddd;
67+
background-color: #fff;
68+
}
69+
.blocklyTreeIcon {
70+
display: none !important;
71+
}
72+
.blocklyFlyoutBackground {
73+
fill: transparent;
74+
}

0 commit comments

Comments
 (0)