diff --git a/src/Css/Functions.cs b/src/Css/Functions.cs index 551bdd6..ad219a8 100644 --- a/src/Css/Functions.cs +++ b/src/Css/Functions.cs @@ -11,6 +11,7 @@ internal static string FormatValue(string key, T value) float v => Wrap(key, v, v != 0), double v => Wrap(key, v, v != 0), Keyframe v => v.ToString(), + PropertySkip v => v.GetValue(key), _ => value?.ToString() }; } diff --git a/src/Css/IProperty.cs b/src/Css/IProperty.cs index 54e6fa7..20e2000 100644 --- a/src/Css/IProperty.cs +++ b/src/Css/IProperty.cs @@ -8,7 +8,14 @@ public interface IProperty public struct PropertySkip { public bool SkipCheck { get; set; } + public Property Value { get; set; } + + public string GetValue(string key) + { + return Value.GetValue(key); + } + public override string ToString() { return Value.ToString(); diff --git a/test/CssInCSharp.Tests/CSSObjectTests.cs b/test/CssInCSharp.Tests/CSSObjectTests.cs index f25d2f1..9ad38c9 100644 --- a/test/CssInCSharp.Tests/CSSObjectTests.cs +++ b/test/CssInCSharp.Tests/CSSObjectTests.cs @@ -80,5 +80,24 @@ public void Animation() }); messageMoveIn.ToString().ShouldBe("MessageMoveIn;@keyframes MessageMoveIn{0%{padding:0;transform:translateY(-100%);opacity:0;}100%{padding:100px;transform:translateY(0);opacity:1;}}"); } - } + + [Fact] + public void Should_Property_Skip_Pxwrap() + { + new CSSObject() + { + [".test"] = new CSSObject() + { + Left = new PropertySkip() + { + SkipCheck = true, + Value = 12 + } + } + } + .ToString() + .ShouldBe(".test{left:12px;}"); + } + + } }