Skip to content

Commit ac6a3f5

Browse files
feat: Gradient.CSS ( Fixes #4 )
1 parent e60adc2 commit ac6a3f5

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Types/Gradient/get_CSS.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<#
2+
.SYNOPSIS
3+
Gets Gradient CSS
4+
.DESCRIPTION
5+
Gets the Gradient as CSS.
6+
.EXAMPLE
7+
gradient '#4488ff', '#224488' |
8+
Select-Object -Expand CSS
9+
#>
10+
param()
11+
# Get our gradient type
12+
$gradientTypes = $this.GradientTypes
13+
$gradientValues = @(foreach ($in in $this.input) {
14+
if ($in -notmatch $this.GradientTypePattern) {
15+
$in
16+
}
17+
})
18+
19+
if (-not $gradientTypes) { $gradientTypes = 'radial-gradient'}
20+
@(foreach ($gradientType in $gradientTypes) {
21+
"$gradientType($(
22+
@(
23+
$gradientValues
24+
) -join ', '
25+
))"
26+
}) -join ', '

0 commit comments

Comments
 (0)