Skip to content

Commit 4d94ef8

Browse files
committed
fix!: rename alignment classes to ns-c to prevent conflict with unocss
1 parent aa16f23 commit 4d94ef8

8 files changed

Lines changed: 57 additions & 61 deletions

File tree

layoutHelper.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,29 @@ export function handleBackground(background?: string, dim = false): CSSPropertie
3434
export function compute_alignment(val) {
3535
switch (val) {
3636
case 'ct':
37-
return 'center top'
37+
return 'ns-c-center ns-c-top'
3838
case 'cm':
39-
return 'center middle'
39+
return 'ns-c-center ns-c-middle'
4040
case 'cb':
41-
return 'center bottom'
41+
return 'ns-c-center ns-c-bottom'
4242
case 'lt':
43-
return 'left top'
43+
return 'ns-c-left ns-c-top'
4444
case 'lm':
45-
return 'left middle'
45+
return 'ns-c-left ns-c-middle'
4646
case 'lb':
47-
return 'left bottom'
47+
return 'ns-c-left ns-c-bottom'
4848
case 'rt':
49-
return 'right top'
49+
return 'ns-c-right ns-c-top'
5050
case 'rm':
51-
return 'right middle'
51+
return 'ns-c-right ns-c-middle'
5252
case 'rb':
53-
return 'right bottom'
53+
return 'ns-c-right ns-c-bottom'
5454
case 'c':
55-
return 'center top'
55+
return 'ns-c-center ns-c-top'
5656
case 'l':
57-
return 'left top'
57+
return 'ns-c-left ns-c-top'
5858
case 'r':
59-
return 'right top'
59+
return 'ns-c-right ns-c-top'
6060
default:
6161
return 'error'
6262
}

layouts/side-title.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const colorscheme = computed(() => {
5050
</script>
5151
<template>
5252
<div v-if="side == 'error' || colwidth == 'error'" class="slidev-layout default error">
53-
<span class="warning"><b>Error</b>: invalid layout params.</span>
53+
<span class="ns-c-warning"><b>Error</b>: invalid layout params.</span>
5454
<hr />
5555
<p>
5656
There are three parameters: <code>color</code>, <code>columns</code> and <code>align</code>. Currently:

layouts/top-title-two-cols.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const colorscheme = computed(() => {
3232
v-if="colwidth == 'error' || alignment.t == 'error' || alignment.l == 'error' || alignment.r == 'error'"
3333
class="slidev-layout default error"
3434
>
35-
<span class="warning"><b>Error</b>: invalid layout params.</span>
35+
<span class="ns-c-warning"><b>Error</b>: invalid layout params.</span>
3636
<hr />
3737
<p>
3838
There are three parameters: <code>columns</code>, <code>align</code>, and <code>color</code>. Currently:

layouts/top-title.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const colorscheme = computed(() => {
2323
</script>
2424
<template>
2525
<div v-if="alignment == 'error'" class="slidev-layout default error">
26-
<span class="warning"><b>Error</b>: invalid layout params.</span>
26+
<span class="ns-c-warning"><b>Error</b>: invalid layout params.</span>
2727
<hr />
2828
<p>
2929
There are two parameters: <code>color</code> <code>align</code>. Currently:

layouts/two-cols-title.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const flexclass = computed(() => {
5454
v-if="colwidth == 'error' || alignment.t == 'error' || alignment.l == 'error' || alignment.r == 'error'"
5555
class="slidev-layout default error"
5656
>
57-
<span class="warning"><b>Error</b>: invalid layout params.</span>
57+
<span class="ns-c-warning"><b>Error</b>: invalid layout params.</span>
5858
<hr />
5959
<p>
6060
There are four parameters: <code>columns</code>, <code>align</code>, <code>color</code>, and

layouts/two-cols.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const colorscheme = computed(() => {
3535
v-if="colwidth == 'error' || alignment.l == 'error' || alignment.r == 'error'"
3636
class="slidev-layout default error"
3737
>
38-
<span class="warning"><b>Error</b>: invalid layout params.</span>
38+
<span class="ns-c-warning"><b>Error</b>: invalid layout params.</span>
3939
<hr />
4040
<p>
4141
There are two parameters: <code>columns</code> and <code>align</code>. Currently:

styles/base.css

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -129,50 +129,6 @@
129129
margin-top: 1.5em;
130130
}
131131

132-
/* columns stuff */
133-
.warning {
134-
color: red;
135-
}
136-
.error {
137-
font-size: 0.9em;
138-
}
139-
140-
.left {
141-
justify-content: left; /* Left align the content */
142-
text-align: left;
143-
align-items: start;
144-
}
145-
146-
.center {
147-
justify-content: center; /* Horizontally center the content */
148-
text-align: center;
149-
align-items: center;
150-
}
151-
152-
.right {
153-
justify-content: right; /* Right align the content */
154-
text-align: right;
155-
align-items: end;
156-
}
157-
158-
.top {
159-
margin-top: 0;
160-
margin-bottom: auto;
161-
}
162-
.middle {
163-
margin-top: auto;
164-
margin-bottom: auto;
165-
}
166-
.bottom {
167-
margin-top: auto;
168-
margin-bottom: 0;
169-
}
170-
171-
/* a new tight bullet list */
172-
/* .tight {
173-
margin-top: 1em;
174-
} */
175-
176132
.bwimg {
177133
filter: grayscale(100%) contrast(150%) brightness(120%);
178134
display: inline;

styles/neversink-c.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,46 @@
4545
4646
4747
*/
48+
49+
/* columns stuff */
50+
.ns-c-warning {
51+
color: red;
52+
}
53+
.ns-c-error {
54+
font-size: 0.9em;
55+
}
56+
57+
.ns-c-left {
58+
justify-content: left; /* Left align the content */
59+
text-align: left;
60+
align-items: start;
61+
}
62+
63+
.ns-c-center {
64+
justify-content: center; /* Horizontally center the content */
65+
text-align: center;
66+
align-items: center;
67+
}
68+
69+
.ns-c-right {
70+
justify-content: right; /* Right align the content */
71+
text-align: right;
72+
align-items: end;
73+
}
74+
75+
.ns-c-top {
76+
margin-top: 0;
77+
margin-bottom: auto;
78+
}
79+
.ns-c-middle {
80+
margin-top: auto;
81+
margin-bottom: auto;
82+
}
83+
.ns-c-bottom {
84+
margin-top: auto;
85+
margin-bottom: 0;
86+
}
87+
4888
/* adds a modifier class which reduces the space between bullets */
4989
.ns-c-tight li {
5090
line-height: normal;

0 commit comments

Comments
 (0)