Files
postcss/lib/raw.coffee
T
2013-12-26 02:23:40 +01:00

20 lines
391 B
CoffeeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Property with raw value (with comments)
class Raw
# Return Raw only if it necessary
@load: (value, raw) ->
if raw? and value != raw
new Raw(value, raw)
else
value
constructor: (@value, @raw) ->
# Stringify to CSS raw value if trimmed wasn’t changed
toString: ->
if @changed
@value || ''
else
@raw || @value || ''
module.exports = Raw