@jaisocx/css-code-snippet 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ExampleCss_CssCodeSnippet.html +209 -0
- package/README.md +20 -0
- package/assets/csstool-codesnippet-theme-styles-main.css +145 -0
- package/assets/lines-numbers-variables/code-snippet-lines-numbers-300.css +3 -0
- package/assets/lines-numbers-variables/code-snippet-lines-numbers-99.css +3 -0
- package/assets/themes/csstool-codesnippet-theme-base.css +50 -0
- package/assets/themes/csstool-codesnippet-theme-colour-blue.css +16 -0
- package/assets/themes/csstool-codesnippet-theme-colour-rosa.css +16 -0
- package/assets/themes/csstool-codesnippet-theme-colour-salad.css +15 -0
- package/assets/themes/csstool-codesnippet-theme-size-large.css +18 -0
- package/assets/themes/csstool-codesnippet-theme-size-little.css +18 -0
- package/build/CommonJS/CssCodeSnippetHelpers.d.ts +5 -0
- package/build/CommonJS/CssCodeSnippetHelpers.d.ts.map +1 -0
- package/build/CommonJS/CssCodeSnippetHelpers.js +41 -0
- package/build/CommonJS/CssCodeSnippetHelpers.js.map +1 -0
- package/build/CommonJS/index.d.ts +2 -0
- package/build/CommonJS/index.d.ts.map +1 -0
- package/build/CommonJS/index.js +6 -0
- package/build/CommonJS/index.js.map +1 -0
- package/build/ESNext/CssCodeSnippetHelpers.d.ts +5 -0
- package/build/ESNext/CssCodeSnippetHelpers.d.ts.map +1 -0
- package/build/ESNext/CssCodeSnippetHelpers.js +37 -0
- package/build/ESNext/CssCodeSnippetHelpers.js.map +1 -0
- package/build/ESNext/index.d.ts +2 -0
- package/build/ESNext/index.d.ts.map +1 -0
- package/build/ESNext/index.js +2 -0
- package/build/ESNext/index.js.map +1 -0
- package/build/Simple/CssCodeSnippetHelpers.js +48 -0
- package/package.json +36 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>css-code-snippet</title>
|
|
6
|
+
|
|
7
|
+
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
|
8
|
+
|
|
9
|
+
<link rel="stylesheet" href="assets/themes/csstool-codesnippet-theme-colour-rosa.css">
|
|
10
|
+
<link rel="stylesheet" href="assets/themes/csstool-codesnippet-theme-colour-salad.css">
|
|
11
|
+
<link rel="stylesheet" href="assets/themes/csstool-codesnippet-theme-colour-blue.css">
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
<link rel="stylesheet" href="assets/themes/csstool-codesnippet-theme-size-large.css">
|
|
15
|
+
<link rel="stylesheet" href="assets/themes/csstool-codesnippet-theme-size-little.css">
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
<link rel="stylesheet" href="assets/themes/csstool-codesnippet-theme-base.css">
|
|
19
|
+
<link rel="stylesheet" href="assets/csstool-codesnippet-theme-styles-main.css">
|
|
20
|
+
|
|
21
|
+
<link rel="stylesheet" href="assets/lines-numbers-variables/code-snippet-lines-numbers-99.css">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<script src="build/Simple/CssCodeSnippetHelpers.js"></script>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<style>
|
|
28
|
+
|
|
29
|
+
.CodeSnippetHolder#code-snippet-example,
|
|
30
|
+
.CodeSnippetHolder#code-snippet-example-thin {
|
|
31
|
+
--lines-number: 29;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.CodeSnippetHolder#code-snippet-example {
|
|
35
|
+
--code-snippet-tool--width: max-content;
|
|
36
|
+
--code-snippet-tool--height: auto;
|
|
37
|
+
--overflow-y: visible;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.CodeSnippetHolder#code-snippet-example-thin {
|
|
41
|
+
--code-snippet-tool--width: 28rem;
|
|
42
|
+
--code-snippet-tool--height: 22rem;
|
|
43
|
+
--overflow-y: auto;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
</style>
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
* {
|
|
51
|
+
margin: 0;
|
|
52
|
+
padding: 0;
|
|
53
|
+
}
|
|
54
|
+
html {
|
|
55
|
+
font-size: 16px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
body {
|
|
59
|
+
width: 100vw;
|
|
60
|
+
background-color: steelblue;
|
|
61
|
+
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
|
|
62
|
+
}
|
|
63
|
+
main {
|
|
64
|
+
width: 80rem;
|
|
65
|
+
height: 100vh;
|
|
66
|
+
margin: 0 auto;
|
|
67
|
+
background-color: aliceblue;
|
|
68
|
+
display: flex !important;
|
|
69
|
+
flex-direction: column !important;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: flex-start;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
h1 {
|
|
75
|
+
font-size: 3rem;
|
|
76
|
+
line-height: 3.8rem;
|
|
77
|
+
margin: 2rem 0;
|
|
78
|
+
text-align: center;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (max-width: 440px) {
|
|
82
|
+
main {
|
|
83
|
+
width: 100vw;
|
|
84
|
+
max-width: 100vw;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
88
|
+
|
|
89
|
+
<style>
|
|
90
|
+
|
|
91
|
+
nav ul {
|
|
92
|
+
display: flex !important;
|
|
93
|
+
}
|
|
94
|
+
nav ul li {
|
|
95
|
+
list-style-type:upper-roman;
|
|
96
|
+
color: #246;
|
|
97
|
+
margin: 0 0.9rem;
|
|
98
|
+
}
|
|
99
|
+
nav ul li a {
|
|
100
|
+
text-decoration: none;
|
|
101
|
+
color: grey;
|
|
102
|
+
}
|
|
103
|
+
nav ul li a:hover {
|
|
104
|
+
color: #09f;
|
|
105
|
+
text-decoration: underline;
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
108
|
+
<script>
|
|
109
|
+
function applyIdAndTheme(themeNames, codeSnippetId) {
|
|
110
|
+
|
|
111
|
+
const h3 = document.querySelector('h3');
|
|
112
|
+
h3.innerHTML = `Theme name: ${themeNames}, <CodeSnippetHolder id="${codeSnippetId}"`;
|
|
113
|
+
|
|
114
|
+
const codeSnippet = document.querySelector('CodeSnippetHolder');
|
|
115
|
+
codeSnippet.className = `CodeSnippetHolder ${themeNames}`;
|
|
116
|
+
codeSnippet.id = codeSnippetId;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function applyH3innerHTML(themeName, codeSnippetId) {
|
|
120
|
+
const h3 = document.querySelector('h3');
|
|
121
|
+
h3.innerHTML = `Theme name: ${themeName}, <CodeSnippetHolder id="${codeSnippetId}"`;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
125
|
+
const CodeSnippetHolder = document.querySelector('CodeSnippetHolder');
|
|
126
|
+
applyH3innerHTML(CodeSnippetHolder.classList.item(1), CodeSnippetHolder.id);
|
|
127
|
+
|
|
128
|
+
CssCodeSnippetHelpers.linesNumbersTextToConsole(3);
|
|
129
|
+
});
|
|
130
|
+
</script>
|
|
131
|
+
</head>
|
|
132
|
+
<body>
|
|
133
|
+
<main>
|
|
134
|
+
<h1>Code snippet css tool</h1>
|
|
135
|
+
<h3>Theme name: salad, CodeSnippetHolder id="code-snippet-example"</h3>
|
|
136
|
+
|
|
137
|
+
<nav>
|
|
138
|
+
<ul>
|
|
139
|
+
<li>
|
|
140
|
+
<a href="javascript: applyIdAndTheme('rosa', 'code-snippet-example')" title="rosa id=code-snippet-example">Rosa fit size</a>
|
|
141
|
+
</li>
|
|
142
|
+
<li>
|
|
143
|
+
<a href="javascript: applyIdAndTheme('rosa', 'code-snippet-example-thin')" title="rosa id=code-snippet-example02">Rosa thin</a>
|
|
144
|
+
</li>
|
|
145
|
+
<li>
|
|
146
|
+
<a href="javascript: applyIdAndTheme('salad', 'code-snippet-example')" title="salad id=code-snippet-example">Salad fit size</a>
|
|
147
|
+
</li>
|
|
148
|
+
<li>
|
|
149
|
+
<a href="javascript: applyIdAndTheme('salad', 'code-snippet-example-thin')" title="salad id=code-snippet-example02">Salad thin</a>
|
|
150
|
+
</li>
|
|
151
|
+
<li>
|
|
152
|
+
<a href="javascript: applyIdAndTheme('blue', 'code-snippet-example')" title="theme-example id=code-snippet-example">Sky Blue fit size</a>
|
|
153
|
+
</li>
|
|
154
|
+
<li>
|
|
155
|
+
<a href="javascript: applyIdAndTheme('blue', 'code-snippet-example-thin')" title="theme-example id=code-snippet-example02">Sky Blue thin</a>
|
|
156
|
+
</li>
|
|
157
|
+
</ul>
|
|
158
|
+
</nav>
|
|
159
|
+
|
|
160
|
+
<nav>
|
|
161
|
+
<ul>
|
|
162
|
+
<li>
|
|
163
|
+
<a href="javascript: applyIdAndTheme('salad large', 'code-snippet-example')" title="salad id=code-snippet-example">Salad fit size, large</a>
|
|
164
|
+
</li>
|
|
165
|
+
<li>
|
|
166
|
+
<a href="javascript: applyIdAndTheme('salad little', 'code-snippet-example-thin')" title="salad id=code-snippet-example02">Salad thin, little</a>
|
|
167
|
+
</li>
|
|
168
|
+
</ul>
|
|
169
|
+
</nav>
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
<CodeSnippetHolder id="code-snippet-example-thin" class="CodeSnippetHolder salad">
|
|
173
|
+
<pre class="CodeSnippetArea">
|
|
174
|
+
import { TestBed } from '@angular/core/testing';
|
|
175
|
+
import { AppComponent } from './app.component';
|
|
176
|
+
|
|
177
|
+
describe('AppComponent', () => {
|
|
178
|
+
beforeEach(async () => {
|
|
179
|
+
await TestBed.configureTestingModule({
|
|
180
|
+
imports: [AppComponent],
|
|
181
|
+
}).compileComponents();
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it('should create the app', () => {
|
|
185
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
186
|
+
const app = fixture.componentInstance;
|
|
187
|
+
expect(app).toBeTruthy();
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it(`should have the 'angular' title`, () => {
|
|
191
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
192
|
+
const app = fixture.componentInstance;
|
|
193
|
+
expect(app.title).toEqual('angular');
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it('should render title', () => {
|
|
197
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
198
|
+
fixture.detectChanges();
|
|
199
|
+
const compiled = fixture.nativeElement as HTMLElement;
|
|
200
|
+
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, angular');
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
</pre>
|
|
204
|
+
</CodeSnippetHolder>
|
|
205
|
+
|
|
206
|
+
</main>
|
|
207
|
+
</html>
|
|
208
|
+
|
|
209
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# CSS Code Snippet
|
|
2
|
+
|
|
3
|
+
## Author, Owner
|
|
4
|
+
Illia Polianskyi
|
|
5
|
+
|
|
6
|
+
## see in action
|
|
7
|
+
1. [https://workspace.brightday.email/ExampleCss_CssCodeSnippet_minimal.html](https://workspace.brightday.email/ExampleCss_CssCodeSnippet_minimal.html)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
2. [https://workspace.brightday.email/ExampleCss_CssCodeSnippet.html](https://workspace.brightday.email/ExampleCss_CssCodeSnippet.html)
|
|
11
|
+
|
|
12
|
+
## github
|
|
13
|
+
|
|
14
|
+
### Parent github project Workspace
|
|
15
|
+
[https://github.com/Jaisocx-Tools/Workspace](https://github.com/Jaisocx-Tools/Workspace)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Css Code Snippet
|
|
19
|
+
[https://github.com/Jaisocx-Tools/Workspace/tree/main/code/ts/www/CssTools/CssCodeSnippet](https://github.com/Jaisocx-Tools/Workspace/tree/main/code/ts/www/CssTools/CssCodeSnippet)
|
|
20
|
+
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/* thin screen, e.g. mobile */
|
|
2
|
+
@media (max-width: 440px) {
|
|
3
|
+
.CodeSnippetHolder {
|
|
4
|
+
max-width: 93vw;
|
|
5
|
+
margin: 0 auto;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* tool css default values */
|
|
10
|
+
.CodeSnippetHolder,
|
|
11
|
+
.CodeSnippetHolder *,
|
|
12
|
+
.CodeSnippetHolder::before,
|
|
13
|
+
.CodeSnippetHolder::after,
|
|
14
|
+
.CodeSnippetHolder *::before,
|
|
15
|
+
.CodeSnippetHolder *::after {
|
|
16
|
+
position: relative;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
|
|
20
|
+
height: auto;
|
|
21
|
+
min-height: 0;
|
|
22
|
+
|
|
23
|
+
width: auto;
|
|
24
|
+
min-width: 0;
|
|
25
|
+
|
|
26
|
+
padding: 0;
|
|
27
|
+
margin: 0;
|
|
28
|
+
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
overflow-y: hidden;
|
|
31
|
+
overflow-x: hidden;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/* tool calculated variables, based on theme variables values */
|
|
36
|
+
.CodeSnippetHolder {
|
|
37
|
+
/* tool calculated variables */
|
|
38
|
+
--code-snippet-holder--height: calc(var(--code-snippet--line-height) * var(--lines-number) + var(--code-snippet--padding-top) + var(--code-snippet--padding-bottom));
|
|
39
|
+
--code-snippet--height: calc(var(--code-snippet--line-height) * var(--lines-number) + var(--code-snippet--padding-top) + var(--code-snippet--padding-bottom));
|
|
40
|
+
--code-snippet--width: calc(100% - var(--column-numbers-holder--width));
|
|
41
|
+
--code-snippet--padding: var(--code-snippet--padding-top) var(--code-snippet--padding-right) 0 var(--code-snippet--padding-left);
|
|
42
|
+
--code-snippet--left: var(--column-numbers-holder--width);
|
|
43
|
+
|
|
44
|
+
--code_snippet__column_numbers__padding: var(--code-snippet--padding-top) var(--code_snippet__column_numbers__padding-right) var(--code-snippet--padding-bottom) 0;
|
|
45
|
+
--column-numbers-holder--width: var(--code_snippet__column_numbers__width);
|
|
46
|
+
--column-numbers-holder--height: calc(var(--code-snippet--line-height) * var(--lines-number) + var(--code-snippet--padding-top));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Main html node */
|
|
50
|
+
.CodeSnippetHolder {
|
|
51
|
+
min-height: var(--code-snippet-tool--height) !important;
|
|
52
|
+
height: var(--code-snippet-tool--height) !important;
|
|
53
|
+
|
|
54
|
+
width: var(--code-snippet-tool--width);
|
|
55
|
+
|
|
56
|
+
overflow: var(--overflow-y) hidden !important;
|
|
57
|
+
overflow-y: var(--overflow-y) !important;
|
|
58
|
+
overflow-x: hidden;
|
|
59
|
+
|
|
60
|
+
background-color: var(--code_snippet__column_numbers__background-color);
|
|
61
|
+
|
|
62
|
+
border-radius: var(--code-snippet-tool--border-radius);
|
|
63
|
+
border: var(--code-snippet-tool--border-width) var(--code-snippet-tool--border-style) var(--code-snippet-tool--border-color);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* the overlapping placeholder, to cover the text near right border,
|
|
67
|
+
to draw right margin, when the width is scrollable to right. */
|
|
68
|
+
.CodeSnippetHolder::after {
|
|
69
|
+
content: "";
|
|
70
|
+
|
|
71
|
+
position: absolute !important;
|
|
72
|
+
|
|
73
|
+
top: 0;
|
|
74
|
+
right: 0;
|
|
75
|
+
|
|
76
|
+
height: var(--code-snippet--height);
|
|
77
|
+
min-height: 100%;
|
|
78
|
+
max-height: var(--code-snippet--height);
|
|
79
|
+
|
|
80
|
+
width: var(--code-snippet--padding-right);
|
|
81
|
+
|
|
82
|
+
background-color: var(--code-snippet--background-color);
|
|
83
|
+
|
|
84
|
+
z-index: 999;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* lines numbers left sidebar */
|
|
88
|
+
.CodeSnippetHolder::before {
|
|
89
|
+
content: var(--lines-numbers--content);
|
|
90
|
+
|
|
91
|
+
top: 0 !important;
|
|
92
|
+
left: 0;
|
|
93
|
+
|
|
94
|
+
float: left;
|
|
95
|
+
|
|
96
|
+
height: var(--column-numbers-holder--height);
|
|
97
|
+
max-height: var(--column-numbers-holder--height);
|
|
98
|
+
|
|
99
|
+
width: var(--code_snippet__column_numbers__width) !important;
|
|
100
|
+
|
|
101
|
+
padding: var(--code_snippet__column_numbers__padding) !important;
|
|
102
|
+
|
|
103
|
+
overflow-y: hidden !important;
|
|
104
|
+
overflow-x: hidden !important;
|
|
105
|
+
|
|
106
|
+
white-space: pre;
|
|
107
|
+
|
|
108
|
+
text-align: right;
|
|
109
|
+
font-size: var(--code-snippet--font-size);
|
|
110
|
+
line-height: var(--code-snippet--line-height);
|
|
111
|
+
|
|
112
|
+
font-family: var(--code_snippet__font_family);
|
|
113
|
+
|
|
114
|
+
color: var(--code_snippet__column_numbers__text-color);
|
|
115
|
+
background-color: var(--code_snippet__column_numbers__background-color);
|
|
116
|
+
|
|
117
|
+
z-index: 9999;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
/* the html pre element, where the inner text is the code snippet */
|
|
122
|
+
.CodeSnippetHolder .CodeSnippetArea {
|
|
123
|
+
top: 0 !important;
|
|
124
|
+
left: 0;
|
|
125
|
+
|
|
126
|
+
height: var(--code-snippet--height);
|
|
127
|
+
min-height: 100%;
|
|
128
|
+
max-height: unset;
|
|
129
|
+
/*max-height: var(--code-snippet--height);*/
|
|
130
|
+
|
|
131
|
+
min-width: auto;
|
|
132
|
+
width: var(--code-snippet--width);
|
|
133
|
+
|
|
134
|
+
padding: var(--code-snippet--padding);
|
|
135
|
+
|
|
136
|
+
overflow-y: hidden !important;
|
|
137
|
+
overflow-x: auto !important;
|
|
138
|
+
|
|
139
|
+
font-size: var(--code-snippet--font-size);
|
|
140
|
+
line-height: var(--code-snippet--line-height);
|
|
141
|
+
font-family: var(--code_snippet__font_family);
|
|
142
|
+
|
|
143
|
+
color: var(--code-snippet--text-color);
|
|
144
|
+
background-color: var(--code-snippet--background-color);
|
|
145
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
.CodeSnippetHolder {
|
|
2
|
+
--lines-numbers--content--300: "\0031\00a\0032\00a\0033\00a\0034\00a\0035\00a\0036\00a\0037\00a\0038\00a\0039\00a\0031\0030\00a\0031\0031\00a\0031\0032\00a\0031\0033\00a\0031\0034\00a\0031\0035\00a\0031\0036\00a\0031\0037\00a\0031\0038\00a\0031\0039\00a\0032\0030\00a\0032\0031\00a\0032\0032\00a\0032\0033\00a\0032\0034\00a\0032\0035\00a\0032\0036\00a\0032\0037\00a\0032\0038\00a\0032\0039\00a\0033\0030\00a\0033\0031\00a\0033\0032\00a\0033\0033\00a\0033\0034\00a\0033\0035\00a\0033\0036\00a\0033\0037\00a\0033\0038\00a\0033\0039\00a\0034\0030\00a\0034\0031\00a\0034\0032\00a\0034\0033\00a\0034\0034\00a\0034\0035\00a\0034\0036\00a\0034\0037\00a\0034\0038\00a\0034\0039\00a\0035\0030\00a\0035\0031\00a\0035\0032\00a\0035\0033\00a\0035\0034\00a\0035\0035\00a\0035\0036\00a\0035\0037\00a\0035\0038\00a\0035\0039\00a\0036\0030\00a\0036\0031\00a\0036\0032\00a\0036\0033\00a\0036\0034\00a\0036\0035\00a\0036\0036\00a\0036\0037\00a\0036\0038\00a\0036\0039\00a\0037\0030\00a\0037\0031\00a\0037\0032\00a\0037\0033\00a\0037\0034\00a\0037\0035\00a\0037\0036\00a\0037\0037\00a\0037\0038\00a\0037\0039\00a\0038\0030\00a\0038\0031\00a\0038\0032\00a\0038\0033\00a\0038\0034\00a\0038\0035\00a\0038\0036\00a\0038\0037\00a\0038\0038\00a\0038\0039\00a\0039\0030\00a\0039\0031\00a\0039\0032\00a\0039\0033\00a\0039\0034\00a\0039\0035\00a\0039\0036\00a\0039\0037\00a\0039\0038\00a\0039\0039\00a\0031\0030\0030\00a\0031\0030\0031\00a\0031\0030\0032\00a\0031\0030\0033\00a\0031\0030\0034\00a\0031\0030\0035\00a\0031\0030\0036\00a\0031\0030\0037\00a\0031\0030\0038\00a\0031\0030\0039\00a\0031\0031\0030\00a\0031\0031\0031\00a\0031\0031\0032\00a\0031\0031\0033\00a\0031\0031\0034\00a\0031\0031\0035\00a\0031\0031\0036\00a\0031\0031\0037\00a\0031\0031\0038\00a\0031\0031\0039\00a\0031\0032\0030\00a\0031\0032\0031\00a\0031\0032\0032\00a\0031\0032\0033\00a\0031\0032\0034\00a\0031\0032\0035\00a\0031\0032\0036\00a\0031\0032\0037\00a\0031\0032\0038\00a\0031\0032\0039\00a\0031\0033\0030\00a\0031\0033\0031\00a\0031\0033\0032\00a\0031\0033\0033\00a\0031\0033\0034\00a\0031\0033\0035\00a\0031\0033\0036\00a\0031\0033\0037\00a\0031\0033\0038\00a\0031\0033\0039\00a\0031\0034\0030\00a\0031\0034\0031\00a\0031\0034\0032\00a\0031\0034\0033\00a\0031\0034\0034\00a\0031\0034\0035\00a\0031\0034\0036\00a\0031\0034\0037\00a\0031\0034\0038\00a\0031\0034\0039\00a\0031\0035\0030\00a\0031\0035\0031\00a\0031\0035\0032\00a\0031\0035\0033\00a\0031\0035\0034\00a\0031\0035\0035\00a\0031\0035\0036\00a\0031\0035\0037\00a\0031\0035\0038\00a\0031\0035\0039\00a\0031\0036\0030\00a\0031\0036\0031\00a\0031\0036\0032\00a\0031\0036\0033\00a\0031\0036\0034\00a\0031\0036\0035\00a\0031\0036\0036\00a\0031\0036\0037\00a\0031\0036\0038\00a\0031\0036\0039\00a\0031\0037\0030\00a\0031\0037\0031\00a\0031\0037\0032\00a\0031\0037\0033\00a\0031\0037\0034\00a\0031\0037\0035\00a\0031\0037\0036\00a\0031\0037\0037\00a\0031\0037\0038\00a\0031\0037\0039\00a\0031\0038\0030\00a\0031\0038\0031\00a\0031\0038\0032\00a\0031\0038\0033\00a\0031\0038\0034\00a\0031\0038\0035\00a\0031\0038\0036\00a\0031\0038\0037\00a\0031\0038\0038\00a\0031\0038\0039\00a\0031\0039\0030\00a\0031\0039\0031\00a\0031\0039\0032\00a\0031\0039\0033\00a\0031\0039\0034\00a\0031\0039\0035\00a\0031\0039\0036\00a\0031\0039\0037\00a\0031\0039\0038\00a\0031\0039\0039\00a\0032\0030\0030\00a\0032\0030\0031\00a\0032\0030\0032\00a\0032\0030\0033\00a\0032\0030\0034\00a\0032\0030\0035\00a\0032\0030\0036\00a\0032\0030\0037\00a\0032\0030\0038\00a\0032\0030\0039\00a\0032\0031\0030\00a\0032\0031\0031\00a\0032\0031\0032\00a\0032\0031\0033\00a\0032\0031\0034\00a\0032\0031\0035\00a\0032\0031\0036\00a\0032\0031\0037\00a\0032\0031\0038\00a\0032\0031\0039\00a\0032\0032\0030\00a\0032\0032\0031\00a\0032\0032\0032\00a\0032\0032\0033\00a\0032\0032\0034\00a\0032\0032\0035\00a\0032\0032\0036\00a\0032\0032\0037\00a\0032\0032\0038\00a\0032\0032\0039\00a\0032\0033\0030\00a\0032\0033\0031\00a\0032\0033\0032\00a\0032\0033\0033\00a\0032\0033\0034\00a\0032\0033\0035\00a\0032\0033\0036\00a\0032\0033\0037\00a\0032\0033\0038\00a\0032\0033\0039\00a\0032\0034\0030\00a\0032\0034\0031\00a\0032\0034\0032\00a\0032\0034\0033\00a\0032\0034\0034\00a\0032\0034\0035\00a\0032\0034\0036\00a\0032\0034\0037\00a\0032\0034\0038\00a\0032\0034\0039\00a\0032\0035\0030\00a\0032\0035\0031\00a\0032\0035\0032\00a\0032\0035\0033\00a\0032\0035\0034\00a\0032\0035\0035\00a\0032\0035\0036\00a\0032\0035\0037\00a\0032\0035\0038\00a\0032\0035\0039\00a\0032\0036\0030\00a\0032\0036\0031\00a\0032\0036\0032\00a\0032\0036\0033\00a\0032\0036\0034\00a\0032\0036\0035\00a\0032\0036\0036\00a\0032\0036\0037\00a\0032\0036\0038\00a\0032\0036\0039\00a\0032\0037\0030\00a\0032\0037\0031\00a\0032\0037\0032\00a\0032\0037\0033\00a\0032\0037\0034\00a\0032\0037\0035\00a\0032\0037\0036\00a\0032\0037\0037\00a\0032\0037\0038\00a\0032\0037\0039\00a\0032\0038\0030\00a\0032\0038\0031\00a\0032\0038\0032\00a\0032\0038\0033\00a\0032\0038\0034\00a\0032\0038\0035\00a\0032\0038\0036\00a\0032\0038\0037\00a\0032\0038\0038\00a\0032\0038\0039\00a\0032\0039\0030\00a\0032\0039\0031\00a\0032\0039\0032\00a\0032\0039\0033\00a\0032\0039\0034\00a\0032\0039\0035\00a\0032\0039\0036\00a\0032\0039\0037\00a\0032\0039\0038\00a\0032\0039\0039\00a\0033\0030\0030\00a";
|
|
3
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
.CodeSnippetHolder {
|
|
2
|
+
--lines-numbers--content--99: "\0031\00a\0032\00a\0033\00a\0034\00a\0035\00a\0036\00a\0037\00a\0038\00a\0039\00a\0031\0030\00a\0031\0031\00a\0031\0032\00a\0031\0033\00a\0031\0034\00a\0031\0035\00a\0031\0036\00a\0031\0037\00a\0031\0038\00a\0031\0039\00a\0032\0030\00a\0032\0031\00a\0032\0032\00a\0032\0033\00a\0032\0034\00a\0032\0035\00a\0032\0036\00a\0032\0037\00a\0032\0038\00a\0032\0039\00a\0033\0030\00a\0033\0031\00a\0033\0032\00a\0033\0033\00a\0033\0034\00a\0033\0035\00a\0033\0036\00a\0033\0037\00a\0033\0038\00a\0033\0039\00a\0034\0030\00a\0034\0031\00a\0034\0032\00a\0034\0033\00a\0034\0034\00a\0034\0035\00a\0034\0036\00a\0034\0037\00a\0034\0038\00a\0034\0039\00a\0035\0030\00a\0035\0031\00a\0035\0032\00a\0035\0033\00a\0035\0034\00a\0035\0035\00a\0035\0036\00a\0035\0037\00a\0035\0038\00a\0035\0039\00a\0036\0030\00a\0036\0031\00a\0036\0032\00a\0036\0033\00a\0036\0034\00a\0036\0035\00a\0036\0036\00a\0036\0037\00a\0036\0038\00a\0036\0039\00a\0037\0030\00a\0037\0031\00a\0037\0032\00a\0037\0033\00a\0037\0034\00a\0037\0035\00a\0037\0036\00a\0037\0037\00a\0037\0038\00a\0037\0039\00a\0038\0030\00a\0038\0031\00a\0038\0032\00a\0038\0033\00a\0038\0034\00a\0038\0035\00a\0038\0036\00a\0038\0037\00a\0038\0038\00a\0038\0039\00a\0039\0030\00a\0039\0031\00a\0039\0032\00a\0039\0033\00a\0039\0034\00a\0039\0035\00a\0039\0036\00a\0039\0037\00a\0039\0038\00a\0039\0039\00a";
|
|
3
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* tool variables */
|
|
2
|
+
.CodeSnippetHolder {
|
|
3
|
+
/* when the assets/lines-numbers-variables/code-snippet-lines-numbers-99.css file is in the .html page,
|
|
4
|
+
then the css variable --lines-numbers--content--99 is loaded.
|
|
5
|
+
|
|
6
|
+
file: code/ts/www/CssTools/CssCodeSnippet/assets/lines-numbers-variables/code-snippet-lines-numbers-300.css
|
|
7
|
+
contains css vriable --lines-numbers--content--300
|
|
8
|
+
|
|
9
|
+
CssCodeSnippetHelpers js class in file build/Simple/CssCodeSnippetHelpers.js
|
|
10
|
+
can produce custom lines numbers text.
|
|
11
|
+
CssCodeSnippetHelpers.linesNumbersTextToConsole( 20 );
|
|
12
|
+
*/
|
|
13
|
+
--lines-numbers--content: var(--lines-numbers--content--99);
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
--code_snippet__font_family: Courier;
|
|
17
|
+
|
|
18
|
+
/* code snippet tool borders */
|
|
19
|
+
/* by color */
|
|
20
|
+
--code-snippet-tool--border-color: lime;
|
|
21
|
+
|
|
22
|
+
/* code snippet tool borders */
|
|
23
|
+
--code-snippet-tool--border-radius: 0;
|
|
24
|
+
--code-snippet-tool--border-width: 0.8px;
|
|
25
|
+
--code-snippet-tool--border-style: solid;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/* theme variables */
|
|
29
|
+
/* code snippet theme sizes variables */
|
|
30
|
+
--code-snippet--line-height: 1.5rem;
|
|
31
|
+
--code-snippet--font-size: 0.875rem;
|
|
32
|
+
--code-snippet--padding-top: 2.0rem;
|
|
33
|
+
--code-snippet--padding-bottom: 2.0rem;
|
|
34
|
+
--code-snippet--padding-left: 0.4rem;
|
|
35
|
+
--code-snippet--padding-right: 1.4rem;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/* code snippet theme Colors variables */
|
|
39
|
+
--code-snippet--text-color: darkgreen;
|
|
40
|
+
--code-snippet--background-color: #fff;
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/* column theme sizes variables */
|
|
44
|
+
--code_snippet__column_numbers__width: 3.3rem;
|
|
45
|
+
--code_snippet__column_numbers__padding-right: 0.8rem;
|
|
46
|
+
|
|
47
|
+
/* column theme Colors variables */
|
|
48
|
+
--code_snippet__column_numbers__text-color: lime;
|
|
49
|
+
--code_snippet__column_numbers__background-color: #efe;
|
|
50
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* tool variables */
|
|
2
|
+
.CodeSnippetHolder.blue {
|
|
3
|
+
|
|
4
|
+
/* code snippet tool borders */
|
|
5
|
+
/* by color */
|
|
6
|
+
--code-snippet-tool--border-color: cornsilk;
|
|
7
|
+
|
|
8
|
+
/* code snippet theme Colors variables */
|
|
9
|
+
--code-snippet--text-color: darkblue;
|
|
10
|
+
--code-snippet--background-color: #fffffa;
|
|
11
|
+
|
|
12
|
+
/* column theme Colors variables */
|
|
13
|
+
--code_snippet__column_numbers__text-color: #09f;
|
|
14
|
+
--code_snippet__column_numbers__background-color: #cef;
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* tool variables */
|
|
2
|
+
.CodeSnippetHolder.rosa {
|
|
3
|
+
|
|
4
|
+
/* code snippet tool borders */
|
|
5
|
+
/* by color */
|
|
6
|
+
--code-snippet-tool--border-color: #fcc;
|
|
7
|
+
|
|
8
|
+
/* code snippet theme Colors variables */
|
|
9
|
+
--code-snippet--text-color: #444;
|
|
10
|
+
--code-snippet--background-color: #fee;
|
|
11
|
+
|
|
12
|
+
/* column theme Colors variables */
|
|
13
|
+
--code_snippet__column_numbers__text-color: #fdd;
|
|
14
|
+
--code_snippet__column_numbers__background-color: white;
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* tool variables */
|
|
2
|
+
.CodeSnippetHolder.salad {
|
|
3
|
+
|
|
4
|
+
/* code snippet tool borders */
|
|
5
|
+
/* by color */
|
|
6
|
+
--code-snippet-tool--border-color: lime;
|
|
7
|
+
|
|
8
|
+
/* code snippet theme Colors variables */
|
|
9
|
+
--code-snippet--text-color: darkgreen;
|
|
10
|
+
--code-snippet--background-color: #fff;
|
|
11
|
+
|
|
12
|
+
/* column theme Colors variables */
|
|
13
|
+
--code_snippet__column_numbers__text-color: lime;
|
|
14
|
+
--code_snippet__column_numbers__background-color: #efe;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* tool variables */
|
|
2
|
+
.CodeSnippetHolder.large {
|
|
3
|
+
|
|
4
|
+
/* theme variables */
|
|
5
|
+
/* code snippet theme sizes variables */
|
|
6
|
+
--code-snippet--line-height: 1.9rem;
|
|
7
|
+
--code-snippet--font-size: 1.5rem;
|
|
8
|
+
--code-snippet--padding-top: 2.0rem;
|
|
9
|
+
--code-snippet--padding-bottom: 2.0rem;
|
|
10
|
+
--code-snippet--padding-left: 0.4rem;
|
|
11
|
+
--code-snippet--padding-right: 1.4rem;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/* column theme sizes variables */
|
|
15
|
+
--code_snippet__column_numbers__width: 4.2rem;
|
|
16
|
+
--code_snippet__column_numbers__padding-right: 0.8rem;
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* tool variables */
|
|
2
|
+
.CodeSnippetHolder.little {
|
|
3
|
+
|
|
4
|
+
/* theme variables */
|
|
5
|
+
/* code snippet theme sizes variables */
|
|
6
|
+
--code-snippet--line-height: 0.97rem;
|
|
7
|
+
--code-snippet--font-size: 0.8rem;
|
|
8
|
+
--code-snippet--padding-top: 2.0rem;
|
|
9
|
+
--code-snippet--padding-bottom: 2.0rem;
|
|
10
|
+
--code-snippet--padding-left: 0.4rem;
|
|
11
|
+
--code-snippet--padding-right: 1.4rem;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/* column theme sizes variables */
|
|
15
|
+
--code_snippet__column_numbers__width: 3.3rem;
|
|
16
|
+
--code_snippet__column_numbers__padding-right: 0.8rem;
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CssCodeSnippetHelpers.d.ts","sourceRoot":"","sources":["../../src/CssCodeSnippetHelpers.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAqB;WAElB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS;WAMzD,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG;CAsC9D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CssCodeSnippetHelpers = void 0;
|
|
4
|
+
class CssCodeSnippetHelpers {
|
|
5
|
+
static linesNumbersTextToConsole(linesNumber) {
|
|
6
|
+
console.info(`Custom lines numbers ( ${linesNumber} ) text generated to use with lines-numbers-variables`, CssCodeSnippetHelpers.getLinesNumbersString(linesNumber));
|
|
7
|
+
}
|
|
8
|
+
static getLinesNumbersString(linesNumber) {
|
|
9
|
+
const numberToUnicode = {
|
|
10
|
+
"0": "\\0030",
|
|
11
|
+
"1": "\\0031",
|
|
12
|
+
"2": "\\0032",
|
|
13
|
+
"3": "\\0033",
|
|
14
|
+
"4": "\\0034",
|
|
15
|
+
"5": "\\0035",
|
|
16
|
+
"6": "\\0036",
|
|
17
|
+
"7": "\\0037",
|
|
18
|
+
"8": "\\0038",
|
|
19
|
+
"9": "\\0039",
|
|
20
|
+
};
|
|
21
|
+
const whiteSpaceEncoded = "\\00a";
|
|
22
|
+
let retValue = "";
|
|
23
|
+
const numbers = [];
|
|
24
|
+
for (let i = 1; i <= linesNumber; i++) {
|
|
25
|
+
numbers.push(i);
|
|
26
|
+
}
|
|
27
|
+
retValue = numbers
|
|
28
|
+
.reduce((previousVaue, currentValue) => {
|
|
29
|
+
let lineNumberString = "" + currentValue;
|
|
30
|
+
let lineNumberStringEncoded = "";
|
|
31
|
+
for (let i = 0; i < lineNumberString.length; i++) {
|
|
32
|
+
lineNumberStringEncoded += numberToUnicode[lineNumberString[i]];
|
|
33
|
+
}
|
|
34
|
+
previousVaue += lineNumberStringEncoded + whiteSpaceEncoded;
|
|
35
|
+
return previousVaue;
|
|
36
|
+
}, "");
|
|
37
|
+
return (retValue);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.CssCodeSnippetHelpers = CssCodeSnippetHelpers;
|
|
41
|
+
//# sourceMappingURL=CssCodeSnippetHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CssCodeSnippetHelpers.js","sourceRoot":"","sources":["../../src/CssCodeSnippetHelpers.ts"],"names":[],"mappings":";;;AAAA,MAAa,qBAAqB;IAEzB,MAAM,CAAC,yBAAyB,CAAC,WAAmB;QACzD,OAAO,CAAC,IAAI,CACV,0BAA0B,WAAW,uDAAuD,EAC5F,qBAAqB,CAAC,qBAAqB,CAAE,WAAW,CAAE,CAAE,CAAC;IACjE,CAAC;IAEM,MAAM,CAAC,qBAAqB,CAAC,WAAmB;QACrD,MAAM,eAAe,GAAQ;YAC3B,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;SACd,CAAC;QAEF,MAAM,iBAAiB,GAAW,OAAO,CAAC;QAE1C,IAAI,QAAQ,GAAW,EAAE,CAAC;QAC1B,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE,EAAG,CAAC;YACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,QAAQ,GAAG,OAAO;aACf,MAAM,CACL,CAAC,YAAY,EAAE,YAAY,EAAE,EAAE;YAC7B,IAAI,gBAAgB,GAAW,EAAE,GAAG,YAAY,CAAC;YACjD,IAAI,uBAAuB,GAAW,EAAE,CAAC;YACzC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC/C,uBAAuB,IAAI,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;YAClE,CAAC;YACD,YAAY,IAAI,uBAAuB,GAAG,iBAAiB,CAAC;YAC5D,OAAO,YAAY,CAAC;QACtB,CAAC,EACD,EAAE,CACH,CAAC;QAEJ,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpB,CAAC;CAEF;AA9CD,sDA8CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CssCodeSnippetHelpers = void 0;
|
|
4
|
+
var CssCodeSnippetHelpers_js_1 = require("./CssCodeSnippetHelpers.js");
|
|
5
|
+
Object.defineProperty(exports, "CssCodeSnippetHelpers", { enumerable: true, get: function () { return CssCodeSnippetHelpers_js_1.CssCodeSnippetHelpers; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CssCodeSnippetHelpers.d.ts","sourceRoot":"","sources":["../../src/CssCodeSnippetHelpers.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAqB;WAElB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS;WAMzD,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG;CAsC9D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export class CssCodeSnippetHelpers {
|
|
2
|
+
static linesNumbersTextToConsole(linesNumber) {
|
|
3
|
+
console.info(`Custom lines numbers ( ${linesNumber} ) text generated to use with lines-numbers-variables`, CssCodeSnippetHelpers.getLinesNumbersString(linesNumber));
|
|
4
|
+
}
|
|
5
|
+
static getLinesNumbersString(linesNumber) {
|
|
6
|
+
const numberToUnicode = {
|
|
7
|
+
"0": "\\0030",
|
|
8
|
+
"1": "\\0031",
|
|
9
|
+
"2": "\\0032",
|
|
10
|
+
"3": "\\0033",
|
|
11
|
+
"4": "\\0034",
|
|
12
|
+
"5": "\\0035",
|
|
13
|
+
"6": "\\0036",
|
|
14
|
+
"7": "\\0037",
|
|
15
|
+
"8": "\\0038",
|
|
16
|
+
"9": "\\0039",
|
|
17
|
+
};
|
|
18
|
+
const whiteSpaceEncoded = "\\00a";
|
|
19
|
+
let retValue = "";
|
|
20
|
+
const numbers = [];
|
|
21
|
+
for (let i = 1; i <= linesNumber; i++) {
|
|
22
|
+
numbers.push(i);
|
|
23
|
+
}
|
|
24
|
+
retValue = numbers
|
|
25
|
+
.reduce((previousVaue, currentValue) => {
|
|
26
|
+
let lineNumberString = "" + currentValue;
|
|
27
|
+
let lineNumberStringEncoded = "";
|
|
28
|
+
for (let i = 0; i < lineNumberString.length; i++) {
|
|
29
|
+
lineNumberStringEncoded += numberToUnicode[lineNumberString[i]];
|
|
30
|
+
}
|
|
31
|
+
previousVaue += lineNumberStringEncoded + whiteSpaceEncoded;
|
|
32
|
+
return previousVaue;
|
|
33
|
+
}, "");
|
|
34
|
+
return (retValue);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=CssCodeSnippetHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CssCodeSnippetHelpers.js","sourceRoot":"","sources":["../../src/CssCodeSnippetHelpers.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,qBAAqB;IAEzB,MAAM,CAAC,yBAAyB,CAAC,WAAmB;QACzD,OAAO,CAAC,IAAI,CACV,0BAA0B,WAAW,uDAAuD,EAC5F,qBAAqB,CAAC,qBAAqB,CAAE,WAAW,CAAE,CAAE,CAAC;IACjE,CAAC;IAEM,MAAM,CAAC,qBAAqB,CAAC,WAAmB;QACrD,MAAM,eAAe,GAAQ;YAC3B,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;SACd,CAAC;QAEF,MAAM,iBAAiB,GAAW,OAAO,CAAC;QAE1C,IAAI,QAAQ,GAAW,EAAE,CAAC;QAC1B,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE,EAAG,CAAC;YACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,QAAQ,GAAG,OAAO;aACf,MAAM,CACL,CAAC,YAAY,EAAE,YAAY,EAAE,EAAE;YAC7B,IAAI,gBAAgB,GAAW,EAAE,GAAG,YAAY,CAAC;YACjD,IAAI,uBAAuB,GAAW,EAAE,CAAC;YACzC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC/C,uBAAuB,IAAI,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;YAClE,CAAC;YACD,YAAY,IAAI,uBAAuB,GAAG,iBAAiB,CAAC;YAC5D,OAAO,YAAY,CAAC;QACtB,CAAC,EACD,EAAE,CACH,CAAC;QAEJ,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpB,CAAC;CAEF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
class CssCodeSnippetHelpers {
|
|
2
|
+
static linesNumbersTextToConsole(linesNumber) {
|
|
3
|
+
console.info(
|
|
4
|
+
`Custom lines numbers ( ${linesNumber} ) text generated to use with lines-numbers-variables`,
|
|
5
|
+
CssCodeSnippetHelpers.getLinesNumbersString(linesNumber));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
static getLinesNumbersString(linesNumber) {
|
|
9
|
+
const numberToUnicode = {
|
|
10
|
+
"0": "\\0030",
|
|
11
|
+
"1": "\\0031",
|
|
12
|
+
"2": "\\0032",
|
|
13
|
+
"3": "\\0033",
|
|
14
|
+
"4": "\\0034",
|
|
15
|
+
"5": "\\0035",
|
|
16
|
+
"6": "\\0036",
|
|
17
|
+
"7": "\\0037",
|
|
18
|
+
"8": "\\0038",
|
|
19
|
+
"9": "\\0039",
|
|
20
|
+
};
|
|
21
|
+
const whiteSpaceEncoded = "\\00a";
|
|
22
|
+
let retValue = "";
|
|
23
|
+
const numbers = [];
|
|
24
|
+
|
|
25
|
+
for (let i = 1; i <= linesNumber; i++) {
|
|
26
|
+
numbers.push(i);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
retValue = numbers
|
|
30
|
+
.reduce(
|
|
31
|
+
(previousVaue, currentValue) => {
|
|
32
|
+
let lineNumberString = "" + currentValue;
|
|
33
|
+
let lineNumberStringEncoded = "";
|
|
34
|
+
|
|
35
|
+
for (let i = 0; i < lineNumberString.length; i++) {
|
|
36
|
+
lineNumberStringEncoded += numberToUnicode[lineNumberString[i]];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
previousVaue += lineNumberStringEncoded + whiteSpaceEncoded;
|
|
40
|
+
|
|
41
|
+
return previousVaue;
|
|
42
|
+
},
|
|
43
|
+
"");
|
|
44
|
+
|
|
45
|
+
return (retValue);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=CssCodeSnippetHelpers.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jaisocx/css-code-snippet",
|
|
3
|
+
"version": "1.2.4",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./build/CommonJS/index.js",
|
|
8
|
+
"types": "./build/ESNext/index.d.ts",
|
|
9
|
+
"module": "./build/ESNext/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
"require": "./build/CommonJS/index.js",
|
|
12
|
+
"import": "./build/ESNext/index.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"build/CommonJS",
|
|
16
|
+
"build/ESNext",
|
|
17
|
+
"build/Simple",
|
|
18
|
+
"assets/",
|
|
19
|
+
"ExampleCss_CssCodeSnippet.html",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"css",
|
|
24
|
+
"styles",
|
|
25
|
+
"ui",
|
|
26
|
+
"code snippet"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"author": "Jaisocx",
|
|
32
|
+
"license": "ISC"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|