Skip to content

Commit 9f683d6

Browse files
authored
Add files via upload
1 parent aee6fb7 commit 9f683d6

10 files changed

Lines changed: 3873 additions & 0 deletions

icons/128x128icon.png

5.26 KB
Loading

icons/200x200icon.png

4.98 KB
Loading

icons/48x48icon.png

1.99 KB
Loading

manifest.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"manifest_version": 3,
3+
"name": "HTML & CSS Code Viewer",
4+
"version": "1.0",
5+
"description": "An interactive HTML and CSS code editor with real-time preview and a sidebar. Easily import, edit, and visualize your code.",
6+
"background": {
7+
"service_worker": "service-worker.js"
8+
},
9+
"action": {
10+
"default_title": "Click to open panel"
11+
},
12+
"icons": {
13+
"48": "icons/48x48icon.png",
14+
"128": "icons/128x128icon.png",
15+
"200": "icons/200x200icon.png"
16+
},
17+
"permissions": [
18+
"sidePanel",
19+
"tabs",
20+
"clipboardRead",
21+
"notifications"
22+
],
23+
"commands": {
24+
"_execute_action": {
25+
"suggested_key": {
26+
"default": "Ctrl+B",
27+
"mac": "Command+B"
28+
}
29+
}
30+
}
31+
}

prism.css

Lines changed: 338 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,338 @@
1+
/* PrismJS 1.29.0
2+
https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript+css-extras&plugins=line-highlight+line-numbers+show-language+inline-color+toolbar+copy-to-clipboard */
3+
/**
4+
* okaidia theme for JavaScript, CSS and HTML
5+
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
6+
* @author ocodia
7+
*/
8+
9+
code[class*="language-"],
10+
pre[class*="language-"] {
11+
color: #f8f8f2;
12+
background: none;
13+
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
14+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
15+
font-size: 1em;
16+
text-align: left;
17+
white-space: pre;
18+
word-spacing: normal;
19+
word-break: normal;
20+
word-wrap: normal;
21+
line-height: 1.5;
22+
23+
-moz-tab-size: 4;
24+
-o-tab-size: 4;
25+
tab-size: 4;
26+
27+
-webkit-hyphens: none;
28+
-moz-hyphens: none;
29+
-ms-hyphens: none;
30+
hyphens: none;
31+
}
32+
33+
/* Code blocks */
34+
pre[class*="language-"] {
35+
padding: 1em;
36+
margin: .5em 0;
37+
overflow: auto;
38+
border-radius: 0.3em;
39+
}
40+
41+
:not(pre) > code[class*="language-"],
42+
pre[class*="language-"] {
43+
background: #272822;
44+
}
45+
46+
/* Inline code */
47+
:not(pre) > code[class*="language-"] {
48+
padding: .1em;
49+
border-radius: .3em;
50+
white-space: normal;
51+
}
52+
53+
.token.comment,
54+
.token.prolog,
55+
.token.doctype,
56+
.token.cdata {
57+
color: #8292a2;
58+
}
59+
60+
.token.punctuation {
61+
color: #f8f8f2;
62+
}
63+
64+
.token.namespace {
65+
opacity: .7;
66+
}
67+
68+
.token.property,
69+
.token.tag,
70+
.token.constant,
71+
.token.symbol,
72+
.token.deleted {
73+
color: #f92672;
74+
}
75+
76+
.token.boolean,
77+
.token.number {
78+
color: #ae81ff;
79+
}
80+
81+
.token.selector,
82+
.token.attr-name,
83+
.token.string,
84+
.token.char,
85+
.token.builtin,
86+
.token.inserted {
87+
color: #a6e22e;
88+
}
89+
90+
.token.operator,
91+
.token.entity,
92+
.token.url,
93+
.language-css .token.string,
94+
.style .token.string,
95+
.token.variable {
96+
color: #f8f8f2;
97+
}
98+
99+
.token.atrule,
100+
.token.attr-value,
101+
.token.function,
102+
.token.class-name {
103+
color: #e6db74;
104+
}
105+
106+
.token.keyword {
107+
color: #66d9ef;
108+
}
109+
110+
.token.regex,
111+
.token.important {
112+
color: #fd971f;
113+
}
114+
115+
.token.important,
116+
.token.bold {
117+
font-weight: bold;
118+
}
119+
.token.italic {
120+
font-style: italic;
121+
}
122+
123+
.token.entity {
124+
cursor: help;
125+
}
126+
127+
pre[data-line] {
128+
position: relative;
129+
padding: 1em 0 1em 3em;
130+
}
131+
132+
.line-highlight {
133+
position: absolute;
134+
left: 0;
135+
right: 0;
136+
padding: inherit 0;
137+
margin-top: 1em; /* Same as .prism’s padding-top */
138+
139+
background: hsla(24, 20%, 50%,.08);
140+
background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
141+
142+
pointer-events: none;
143+
144+
line-height: inherit;
145+
white-space: pre;
146+
}
147+
148+
@media print {
149+
.line-highlight {
150+
/*
151+
* This will prevent browsers from replacing the background color with white.
152+
* It's necessary because the element is layered on top of the displayed code.
153+
*/
154+
-webkit-print-color-adjust: exact;
155+
color-adjust: exact;
156+
}
157+
}
158+
159+
.line-highlight:before,
160+
.line-highlight[data-end]:after {
161+
content: attr(data-start);
162+
position: absolute;
163+
top: .4em;
164+
left: .6em;
165+
min-width: 1em;
166+
padding: 0 .5em;
167+
background-color: hsla(24, 20%, 50%,.4);
168+
color: hsl(24, 20%, 95%);
169+
font: bold 65%/1.5 sans-serif;
170+
text-align: center;
171+
vertical-align: .3em;
172+
border-radius: 999px;
173+
text-shadow: none;
174+
box-shadow: 0 1px white;
175+
}
176+
177+
.line-highlight[data-end]:after {
178+
content: attr(data-end);
179+
top: auto;
180+
bottom: .4em;
181+
}
182+
183+
.line-numbers .line-highlight:before,
184+
.line-numbers .line-highlight:after {
185+
content: none;
186+
}
187+
188+
pre[id].linkable-line-numbers span.line-numbers-rows {
189+
pointer-events: all;
190+
}
191+
pre[id].linkable-line-numbers span.line-numbers-rows > span:before {
192+
cursor: pointer;
193+
}
194+
pre[id].linkable-line-numbers span.line-numbers-rows > span:hover:before {
195+
background-color: rgba(128, 128, 128, .2);
196+
}
197+
198+
pre[class*="language-"].line-numbers {
199+
position: relative;
200+
padding-left: 3.8em;
201+
counter-reset: linenumber;
202+
}
203+
204+
pre[class*="language-"].line-numbers > code {
205+
position: relative;
206+
white-space: inherit;
207+
}
208+
209+
.line-numbers .line-numbers-rows {
210+
position: absolute;
211+
pointer-events: none;
212+
top: 0;
213+
font-size: 100%;
214+
left: -3.8em;
215+
width: 3em; /* works for line-numbers below 1000 lines */
216+
letter-spacing: -1px;
217+
border-right: 1px solid #999;
218+
219+
-webkit-user-select: none;
220+
-moz-user-select: none;
221+
-ms-user-select: none;
222+
user-select: none;
223+
224+
}
225+
226+
.line-numbers-rows > span {
227+
display: block;
228+
counter-increment: linenumber;
229+
}
230+
231+
.line-numbers-rows > span:before {
232+
content: counter(linenumber);
233+
color: #999;
234+
display: block;
235+
padding-right: 0.8em;
236+
text-align: right;
237+
}
238+
239+
div.code-toolbar {
240+
position: relative;
241+
}
242+
243+
div.code-toolbar > .toolbar {
244+
position: absolute;
245+
z-index: 10;
246+
top: .3em;
247+
right: .2em;
248+
transition: opacity 0.3s ease-in-out;
249+
opacity: 0;
250+
}
251+
252+
div.code-toolbar:hover > .toolbar {
253+
opacity: 1;
254+
}
255+
256+
/* Separate line b/c rules are thrown out if selector is invalid.
257+
IE11 and old Edge versions don't support :focus-within. */
258+
div.code-toolbar:focus-within > .toolbar {
259+
opacity: 1;
260+
}
261+
262+
div.code-toolbar > .toolbar > .toolbar-item {
263+
display: inline-block;
264+
}
265+
266+
div.code-toolbar > .toolbar > .toolbar-item > a {
267+
cursor: pointer;
268+
}
269+
270+
div.code-toolbar > .toolbar > .toolbar-item > button {
271+
background: none;
272+
border: 0;
273+
color: inherit;
274+
font: inherit;
275+
line-height: normal;
276+
overflow: visible;
277+
padding: 0;
278+
-webkit-user-select: none; /* for button */
279+
-moz-user-select: none;
280+
-ms-user-select: none;
281+
}
282+
283+
div.code-toolbar > .toolbar > .toolbar-item > a,
284+
div.code-toolbar > .toolbar > .toolbar-item > button,
285+
div.code-toolbar > .toolbar > .toolbar-item > span {
286+
color: #bbb;
287+
font-size: .8em;
288+
padding: 0 .5em;
289+
background: #f5f2f0;
290+
background: rgba(224, 224, 224, 0.2);
291+
box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
292+
border-radius: .5em;
293+
}
294+
295+
div.code-toolbar > .toolbar > .toolbar-item > a:hover,
296+
div.code-toolbar > .toolbar > .toolbar-item > a:focus,
297+
div.code-toolbar > .toolbar > .toolbar-item > button:hover,
298+
div.code-toolbar > .toolbar > .toolbar-item > button:focus,
299+
div.code-toolbar > .toolbar > .toolbar-item > span:hover,
300+
div.code-toolbar > .toolbar > .toolbar-item > span:focus {
301+
color: inherit;
302+
text-decoration: none;
303+
}
304+
305+
span.inline-color-wrapper {
306+
/*
307+
* The background image is the following SVG inline in base 64:
308+
*
309+
* <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2">
310+
* <path fill="gray" d="M0 0h2v2H0z"/>
311+
* <path fill="white" d="M0 0h1v1H0zM1 1h1v1H1z"/>
312+
* </svg>
313+
*
314+
* SVG-inlining explained:
315+
* https://stackoverflow.com/a/21626701/7595472
316+
*/
317+
background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyIDIiPjxwYXRoIGZpbGw9ImdyYXkiIGQ9Ik0wIDBoMnYySDB6Ii8+PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik0wIDBoMXYxSDB6TTEgMWgxdjFIMXoiLz48L3N2Zz4=");
318+
/* This is to prevent visual glitches where one pixel from the repeating pattern could be seen. */
319+
background-position: center;
320+
background-size: 110%;
321+
322+
display: inline-block;
323+
height: 1.333ch;
324+
width: 1.333ch;
325+
margin: 0 .333ch;
326+
box-sizing: border-box;
327+
border: 1px solid white;
328+
outline: 1px solid rgba(0,0,0,.5);
329+
overflow: hidden;
330+
}
331+
332+
span.inline-color {
333+
display: block;
334+
/* To prevent visual glitches again */
335+
height: 120%;
336+
width: 120%;
337+
}
338+

0 commit comments

Comments
 (0)