Skip to content

Commit

Permalink
fix: 🔥 fix bugs from winidicss
Browse files Browse the repository at this point in the history
  • Loading branch information
okikio authored May 4, 2021
1 parent 79bd0ff commit f71d692
Show file tree
Hide file tree
Showing 10 changed files with 403 additions and 57 deletions.
357 changes: 352 additions & 5 deletions docs/css/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/css/playground.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/js/main.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/js/main.min.js.map

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ task("css", async () => {

{ default: scss },
{ default: sass },

{ default: autoprefixer },
{ default: csso },
] = await Promise.all([
import("gulp-postcss"),
import("tailwindcss"),
Expand All @@ -66,18 +63,15 @@ task("css", async () => {

import("postcss-scss"),
import("@csstools/postcss-sass"),

import("autoprefixer"),
import("postcss-csso"),
]);

return stream(`${cssSrcFolder}/*.css`, {
pipes: [
// Minify scss to css
postcss([
_import(),
tailwind("./tailwind.cjs"),
sass({ outputStyle: "compressed" }),
tailwind("./tailwind.cjs"),
], { syntax: scss }),
],
dest: cssFolder,
Expand Down Expand Up @@ -248,7 +242,7 @@ task("watch", async () => {
);

watch(`${pugFolder}/**/*.pug`, series("html"));
watch([`${cssSrcFolder}/**/*.scss`, `./tailwind.cjs`], series("css"));
watch([`${cssSrcFolder}/**/*.css`, `./tailwind.cjs`], series("css"));
watch(`${tsFolder}/**/*.ts`, series("js"));

watch(
Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
}
},
"dependencies": {
"@codemirror/basic-setup": "^0.18.0",
"@codemirror/commands": "^0.18.1",
"@codemirror/lang-javascript": "^0.18.0",
"@codemirror/view": "^0.18.11",
"@uupaa/dynamic-import-polyfill": "^1.0.2",
"assert": "^2.0.0",
"buffer": "^6.0.3",
Expand Down Expand Up @@ -69,7 +65,7 @@
"husky": "^6.0.0",
"lodash-es": "^4.17.21",
"plugin-error": "^1.0.1",
"pnpm": "^6.2.3",
"pnpm": "^6.2.5",
"postcss": "^8.2.13",
"postcss-advanced-variables": "^3.0.1",
"postcss-cli": "^8.3.1",
Expand Down
14 changes: 10 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions src/css/components/navbar.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.navbar {
@apply fixed top-0 left-0 w-full z-50;
@apply backdrop-filter backdrop-blur dark:backdrop-blur-md;

@supports (backdrop-filter: blur(5px)) {
@apply backdrop-filter backdrop-blur dark:backdrop-blur-md;
}

.container {
@apply sm:max-w-screen-lg px-5 h-full relative;
Expand All @@ -15,6 +18,13 @@
@apply dark:bg-elevated;
}

.navbar-bg,
&.shadow .navbar-bg {
@supports (backdrop-filter: blur(5px)) {
@apply dark:bg-opacity-60;
}
}

.navbar-frame {
@apply flex flex-wrap items-center justify-between relative;
@apply w-full py-2;
Expand Down Expand Up @@ -62,10 +72,3 @@
@apply bg-opacity-60;
}
}

@supports (backdrop-filter: blur(5px)) {
.navbar-bg,
.navbar.shadow .navbar-bg {
@apply dark:bg-opacity-60;
}
}
2 changes: 1 addition & 1 deletion src/css/playground.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#app {
@apply border border-gray-200 dark:border-transparent;
@apply overflow-hidden rounded-lg shadow-lg;
@apply rounded-lg shadow-lg;
@apply bg-white;
padding-top: 15px;
height: 400px;
Expand Down
43 changes: 21 additions & 22 deletions src/ts/modules/playground.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { importShim } from "../util/dynamic-import";
import { editor as Editor } from "monaco-editor";

import { editor as Editor, languages } from "monaco-editor";
import GithubLight from "../util/github-light";
import GithubDark from "../util/github-dark";
import { themeGet } from "../theme";
Expand All @@ -16,6 +17,24 @@ export const build = () => {
let divEl = document.querySelector("#editor") as HTMLElement;
let editor: Editor.IStandaloneCodeEditor;

// Compiler options
languages.typescript.typescriptDefaults.setCompilerOptions({
"moduleResolution": languages.typescript.ModuleResolutionKind.NodeJs,
"target": languages.typescript.ScriptTarget.ES2020,
"module": languages.typescript.ModuleKind.ES2015,
"lib": [
"ES2019",
"DOM",
"DOM.Iterable"
],
"resolveJsonModule": true,
"isolatedModules": true,
"allowNonTsExtensions": true,
"esModuleInterop": true,
"noResolve": true
});


// Since packaging is done by you, you need
// to instruct the editor how you named the
// bundles that contain the web workers.
Expand Down Expand Up @@ -45,7 +64,7 @@ export const build = () => {
Editor.defineTheme("light", GithubLight);

editor = Editor.create(divEl, {
value: `export {};`,
value: `// @ts-ignore\nexport * from "rollup";`,
minimap: {
enabled: false,
},
Expand All @@ -63,24 +82,4 @@ export const build = () => {
Editor.setTheme(themeGet());
});

try {
(async () => {
// const { default: size } = await importShim("./esbuild.js");

/**
* We need to debounce a bit the compilation because
* it takes ~15ms to compile with the web worker...
* Also, real time feedback can be stressful
*/
// let timer = window.setInterval(() => {
// (async () => {
// console.log("Cool");
// console.log(await size(`export * as pkg from "@okikio/native";`));
// })();
// window.clearInterval(timer);
// }, 500);
})();
} catch (e) {
console.warn(`Esbuild has failed to load...`, e);
}
};

0 comments on commit f71d692

Please sign in to comment.