Skip to content

Commit

Permalink
vs code CSS ineject
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbos committed Dec 21, 2023
1 parent 95573cf commit 280285c
Show file tree
Hide file tree
Showing 7 changed files with 815 additions and 0 deletions.
17 changes: 17 additions & 0 deletions vscode-custom-css-inject/client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const websocket = new WebSocket(`ws://localhost:5786`);

websocket.onmessage = (message) => {
const data = JSON.parse(message.data);
if (data.type === `css`) {
document.querySelector(`style#${data.id}`).innerHTML = data.css;
}
console.log(`Received:`, data);
};

websocket.onclose = () => {
console.log(`Disconnected`);
};

websocket.onerror = (error) => {
console.log(`Error: ${error}`);
};
30 changes: 30 additions & 0 deletions vscode-custom-css-inject/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* Test */

/* Method 1: Fix it! */
/* Solution: Fix it! */
/** Problem 1: */
/* todo: Fix later */
/** this is a regular comment*/
/** this is a
multi line comment
*/

.monaco-editor {
& span.ced-1-TextEditorDecorationType22-1,
span.ced-1-TextEditorDecorationType26-1 {
background: #ffc600;
box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.01), 0 0 10px 10px rgba(0, 0, 0, 0.1);
font-family: "Radnika Next";
font-weight: 900;
padding: 0px;
line-height: 1.5;
color: black !important;
display: inline-block;
transform: rotate(-1deg);
}
}

/* this is handy for testing if its working */
.editor-container {
border: 2px solid orange !important;
}
Loading

0 comments on commit 280285c

Please sign in to comment.