(text: string, start = 0)
| 487 | } |
| 488 | |
| 489 | export function parseColorStop(text: string, start = 0): Parsed<ColorStop> { |
| 490 | const color = parseColor(text, start); |
| 491 | if (!color) { |
| 492 | return null; |
| 493 | } |
| 494 | let end = color.end; |
| 495 | const offset = parsePercentageOrLength(text, end); |
| 496 | if (offset) { |
| 497 | end = offset.end; |
| 498 | |
| 499 | return { |
| 500 | start, |
| 501 | end, |
| 502 | value: { color: color.value, offset: offset.value }, |
| 503 | }; |
| 504 | } |
| 505 | |
| 506 | return { start, end, value: { color: color.value } }; |
| 507 | } |
| 508 | |
| 509 | const linearGradientStartRegEx = /\s*linear-gradient\s*/gy; |
| 510 | export function parseLinearGradient(text: string, start = 0): Parsed<LinearGradient> { |
no test coverage detected