Skip to content

Commit d02db41

Browse files
committed
fix: Function with dot inside name
1 parent 0357c82 commit d02db41

22 files changed

+677
-918
lines changed

lib/nodes/Func.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class Func extends Container {
123123

124124
// fixes #92
125125
// eslint-disable-next-line no-useless-escape
126-
if (!reFunctions.test(node.name) && !/^[a-zA-Z\-]+$/.test(node.name)) {
126+
if (!reFunctions.test(node.name) && !/^[a-zA-Z\-\.]+$/.test(node.name)) {
127127
const nameTokens = getTokens(node.name);
128128
tokens.unshift(...nameTokens, brackets);
129129
parser.back(tokens);

test/fixtures/func.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ module.exports = {
4747
'1em/var(--line-height)',
4848
'local(foo),local(bar)',
4949
'bat-man(#000)',
50-
'conic-gradient()'
50+
'conic-gradient()',
51+
'color.red(#6b717f)'
5152
],
5253

5354
throws: ['url( /gfx/img/bg.jpg ']

test/snapshots/atword.test.js.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ Generated by [AVA](https://avajs.dev).
2828
source: {
2929
input: Input {
3030
css: ' @word ',
31+
fromOffset: Function {},
3132
hasBOM: false,
3233
id: '<input css 1>',
33-
[Symbol(fromOffset cache)]: [
34-
0,
35-
],
3634
},
3735
start: {
3836
column: 3,
@@ -41,6 +39,7 @@ Generated by [AVA](https://avajs.dev).
4139
},
4240
},
4341
type: 'atword',
42+
[Symbol(isComplete)]: false,
4443
[Symbol(isClean)]: false,
4544
},
4645
]

test/snapshots/atword.test.js.snap

3 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)