File tree 4 files changed +15
-24
lines changed 4 files changed +15
-24
lines changed Original file line number Diff line number Diff line change @@ -1769,7 +1769,15 @@ declaration.
1769
1769
-}
1770
1770
important : Style -> Style
1771
1771
important =
1772
- Preprocess . mapLastProperty ( \ property -> { property | important = True } )
1772
+ Preprocess . mapLastProperty ( \ property -> { property | value = makeImportant property. value } )
1773
+
1774
+
1775
+ makeImportant : String -> String
1776
+ makeImportant value =
1777
+ if String . endsWith " !important" ( String . toLower value) then
1778
+ value
1779
+ else
1780
+ value ++ " !important"
1773
1781
1774
1782
1775
1783
{- | A [`ColorValue`](#ColorValue) that does not have `red`, `green`, or `blue`
@@ -7744,7 +7752,7 @@ batch =
7744
7752
-}
7745
7753
property : String -> String -> Style
7746
7754
property key value =
7747
- { key = key, value = value, important = False }
7755
+ { key = key, value = value }
7748
7756
|> Preprocess . AppendProperty
7749
7757
7750
7758
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ stylesheet snippets =
19
19
type alias Property =
20
20
{ key : String
21
21
, value : String
22
- , important : Bool
23
22
}
24
23
25
24
@@ -154,11 +153,4 @@ toPropertyPairs styles =
154
153
155
154
propertyToPair : Property -> ( String , String )
156
155
propertyToPair property =
157
- let
158
- value =
159
- if property. important then
160
- property. value ++ " !important"
161
- else
162
- property. value
163
- in
164
- ( property. key, value )
156
+ ( property. key, property. value )
Original file line number Diff line number Diff line change @@ -16,12 +16,10 @@ type alias Number compatible =
16
16
{ compatible | value : String , number : Compatible }
17
17
18
18
19
- {- | A property consisting of a key, a value, and a flag for whether or not
20
- the property is `!important`.
19
+ {- | A property consisting of a key and a value
21
20
-}
22
21
type alias Property =
23
- { important : Bool
24
- , key : String
22
+ { key : String
25
23
, value : String
26
24
}
27
25
Original file line number Diff line number Diff line change @@ -229,15 +229,8 @@ combinatorToString combinator =
229
229
230
230
231
231
prettyPrintProperty : Property -> String
232
- prettyPrintProperty { key, value, important } =
233
- let
234
- suffix =
235
- if important then
236
- " !important;"
237
- else
238
- " ;"
239
- in
240
- key ++ " : " ++ value ++ suffix
232
+ prettyPrintProperty { key, value } =
233
+ key ++ " : " ++ value ++ " ;"
241
234
242
235
243
236
{- | Indent the given string with 4 spaces
You can’t perform that action at this time.
0 commit comments