Skip to content

Commit bd46592

Browse files
deadlyjackAjit Kumar
andauthored
fix(css in other type editor file) (#1507)
Co-authored-by: Ajit Kumar <dellevenjack@gmail>
1 parent 29b3d41 commit bd46592

File tree

4 files changed

+6
-28
lines changed

4 files changed

+6
-28
lines changed

src/lib/console.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import "core-js/stable";
22
import "html-tag-js/dist/polyfill";
33
import * as esprima from "esprima";
4-
import css from "styles/console.module.scss";
4+
import css from "styles/console.m.scss";
55
import loadPolyFill from "utils/polyfill";
66

77
(function () {

src/lib/editorFile.js

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -229,42 +229,20 @@ export default class EditorFile {
229229
container.appendChild(content);
230230
this.#content = container;
231231
} else {
232-
container = tag("div", {
233-
className: "tab-page-container",
234-
});
232+
container = <div className="tab-page-container" />;
235233

236234
// shadow dom
237235
shadow = container.attachShadow({ mode: "open" });
238236

239-
// main app styles
240-
const mainStyle = tag("link", {
241-
rel: "stylesheet",
242-
href: "./css/build/main.css",
243-
});
244-
// icon styles
245-
const iconStyle = tag("link", {
246-
rel: "stylesheet",
247-
href: "./res/icons/style.css",
248-
});
249-
// file icon styles
250-
const fileIconStyle = tag("link", {
251-
rel: "stylesheet",
252-
href: "./res/file-icons/style.css",
253-
});
254-
255237
// Add base styles to shadow DOM first
256-
shadow.appendChild(mainStyle);
257-
shadow.appendChild(iconStyle);
258-
shadow.appendChild(fileIconStyle);
238+
shadow.appendChild(<link rel="stylesheet" href="build/main.css" />);
259239

260240
// Handle custom stylesheets if provided
261241
if (options.stylesheets) {
262242
this.#addCustomStyles(options.stylesheets, shadow);
263243
}
264244

265-
const content = tag("div", {
266-
className: "tab-page-content",
267-
});
245+
const content = <div className="tab-page-content" />;
268246

269247
if (typeof options.content === "string") {
270248
content.innerHTML = DOMPurify.sanitize(options.content);
File renamed without changes.

webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = (env, options) => {
1212
use: ['raw-loader'],
1313
},
1414
{
15-
test: /\.module.(sa|sc|c)ss$/,
15+
test: /\.m.(sa|sc|c)ss$/,
1616
use: [
1717
'raw-loader',
1818
'postcss-loader',
@@ -24,7 +24,7 @@ module.exports = (env, options) => {
2424
type: "asset/resource",
2525
},
2626
{
27-
test: /(?<!\.module)\.(sa|sc|c)ss$/,
27+
test: /(?<!\.m)\.(sa|sc|c)ss$/,
2828
use: [
2929
{
3030
loader: MiniCssExtractPlugin.loader,

0 commit comments

Comments
 (0)