Skip to content

Commit bec9f6f

Browse files
committed
use % sign in the name of the uility
1 parent 2e55a5d commit bec9f6f

File tree

3 files changed

+52
-52
lines changed

3 files changed

+52
-52
lines changed

oxide/crates/core/src/parser.rs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ impl<'a> Extractor<'a> {
4343

4444
#[cfg(test)]
4545
pub fn unique_ord(input: &'a [u8], opts: ExtractorOptions) -> Vec<&'a [u8]> {
46-
// This is an inefficient way to get an ordered, unique
47-
// list as a Vec but it is only meant for testing.
48-
let mut candidates = Self::all(input, opts);
49-
let mut unique_list = FxHashSet::default();
50-
unique_list.reserve(candidates.len());
51-
candidates.retain(|c| unique_list.insert(*c));
46+
// This is an inefficient way to get an ordered, unique
47+
// list as a Vec but it is only meant for testing.
48+
let mut candidates = Self::all(input, opts);
49+
let mut unique_list = FxHashSet::default();
50+
unique_list.reserve(candidates.len());
51+
candidates.retain(|c| unique_list.insert(*c));
5252

53-
candidates
53+
candidates
5454
}
5555
}
5656

@@ -319,7 +319,16 @@ impl<'a> Extractor<'a> {
319319

320320
// Allowed characters in the candidate itself
321321
// None of these can come after a closing bracket `]`
322-
b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9' | b'-' | b'_' | b'(' | b')' | b'!' | b'@'
322+
b'a'..=b'z'
323+
| b'A'..=b'Z'
324+
| b'0'..=b'9'
325+
| b'-'
326+
| b'_'
327+
| b'('
328+
| b')'
329+
| b'!'
330+
| b'@'
331+
| b'%'
323332
if prev != b']' =>
324333
{
325334
/* TODO: The `b'@'` is necessary for custom separators like _@, maybe we can handle this in a better way... */

stubs/config.full.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -356,27 +356,27 @@ module.exports = {
356356
gap: ({ theme }) => theme('spacing'),
357357
gradientColorStops: ({ theme }) => theme('colors'),
358358
gradientColorStopPositions: {
359-
0: '0%',
360-
5: '5%',
361-
10: '10%',
362-
15: '15%',
363-
20: '20%',
364-
25: '25%',
365-
30: '30%',
366-
35: '35%',
367-
40: '40%',
368-
45: '45%',
369-
50: '50%',
370-
55: '55%',
371-
60: '60%',
372-
65: '65%',
373-
70: '70%',
374-
75: '75%',
375-
80: '80%',
376-
85: '85%',
377-
90: '90%',
378-
95: '95%',
379-
100: '100%',
359+
'0%': '0%',
360+
'5%': '5%',
361+
'10%': '10%',
362+
'15%': '15%',
363+
'20%': '20%',
364+
'25%': '25%',
365+
'30%': '30%',
366+
'35%': '35%',
367+
'40%': '40%',
368+
'45%': '45%',
369+
'50%': '50%',
370+
'55%': '55%',
371+
'60%': '60%',
372+
'65%': '65%',
373+
'70%': '70%',
374+
'75%': '75%',
375+
'80%': '80%',
376+
'85%': '85%',
377+
'90%': '90%',
378+
'95%': '95%',
379+
'100%': '100%',
380380
},
381381
grayscale: {
382382
0: '0',

tests/plugins/gradientColorStops.test.js

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ crosscheck(({ stable, oxide }) => {
137137
<div
138138
class="bg-gradient-to-r from-red-500 from-50 via-pink-500 via-75 to-violet-400 to-80"
139139
></div>
140-
<div class="from-10 from-[14%]"></div>
141-
<div class="via-10 via-[14%]"></div>
142-
<div class="to-10 to-[14%]"></div>
140+
<div class="from-10% from-[11%]"></div>
141+
<div class="via-20% via-[12%]"></div>
142+
<div class="to-30% to-[13%]"></div>
143143
</div>
144144
`,
145145
},
@@ -159,14 +159,11 @@ crosscheck(({ stable, oxide }) => {
159159
--tw-gradient-to-position: ;
160160
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
161161
}
162-
.from-10 {
162+
.from-10\% {
163163
--tw-gradient-from-position: 10%;
164164
}
165-
.from-50 {
166-
--tw-gradient-from-position: 50%;
167-
}
168-
.from-\[14\%\] {
169-
--tw-gradient-from-position: 14%;
165+
.from-\[11\%\] {
166+
--tw-gradient-from-position: 11%;
170167
}
171168
.via-pink-500 {
172169
--tw-gradient-via-position: ;
@@ -175,27 +172,21 @@ crosscheck(({ stable, oxide }) => {
175172
--tw-gradient-stops: var(--tw-gradient-from), #ec4899 var(--tw-gradient-via-position),
176173
var(--tw-gradient-to);
177174
}
178-
.via-10 {
179-
--tw-gradient-via-position: 10%;
180-
}
181-
.via-75 {
182-
--tw-gradient-via-position: 75%;
175+
.via-20\% {
176+
--tw-gradient-via-position: 20%;
183177
}
184-
.via-\[14\%\] {
185-
--tw-gradient-via-position: 14%;
178+
.via-\[12\%\] {
179+
--tw-gradient-via-position: 12%;
186180
}
187181
.to-violet-400 {
188182
--tw-gradient-to: #a78bfa var(--tw-gradient-to-position);
189183
--tw-gradient-to-position: ;
190184
}
191-
.to-10 {
192-
--tw-gradient-to-position: 10%;
193-
}
194-
.to-80 {
195-
--tw-gradient-to-position: 80%;
185+
.to-30\% {
186+
--tw-gradient-to-position: 30%;
196187
}
197-
.to-\[14\%\] {
198-
--tw-gradient-to-position: 14%;
188+
.to-\[13\%\] {
189+
--tw-gradient-to-position: 13%;
199190
}
200191
`)
201192
})

0 commit comments

Comments
 (0)