File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,20 +46,44 @@ return "$($this.CSS)"
4646param()
4747# Get our gradient type
4848$gradientTypes = $this.GradientTypes
49+
50+ $gradientStack = @()
51+
4952$gradientValues = @(foreach ($in in $this.input) {
53+ if ($in.pstypenames -eq 'gradient') {
54+ $gradientStack += $in
55+ continue
56+ }
5057 if ($in -notmatch $this.GradientTypePattern) {
5158 $in
5259 }
5360})
5461
55- if (-not $gradientTypes) { $gradientTypes = 'radial-gradient'}
56- @(foreach ($gradientType in $gradientTypes) {
57- "$gradientType($(
58- @(
59- $gradientValues
60- ) -join (', ' + [Environment]::NewLine + (' ' * 2))
61- ))"
62- }) -join ', '
62+ if ($gradientValues) {
63+ if (-not $gradientTypes) { $gradientTypes = 'radial-gradient'}
64+ $gradientCss = @(foreach ($gradientType in $gradientTypes) {
65+ "$gradientType($(
66+ [Environment]::NewLine + (' ' * 2) +
67+ $(
68+ @(
69+ $gradientValues
70+ ) -join (', ' + [Environment]::NewLine + (' ' * 2))
71+ )
72+ ))"
73+ }) -join ', '
74+ }
75+ if ($gradientStack) {
76+ $deepJoiner = (', ' + [Environment]::NewLine)
77+ if (-not $gradientValues) {
78+ $gradientStack -join $deepJoiner
79+ } else {
80+ @($gradientStack;$gradientCss) -join $deepJoiner
81+ }
82+ } elseif ($gradientValues) {
83+ $gradientCss
84+ }
85+
86+
6387 </GetScriptBlock >
6488 </ScriptProperty >
6589 <ScriptProperty >
You can’t perform that action at this time.
0 commit comments