diff --git a/src/ExCSS.Tests/PropertyTests/FlexPropertyTests.cs b/src/ExCSS.Tests/PropertyTests/FlexPropertyTests.cs new file mode 100644 index 00000000..887ee15d --- /dev/null +++ b/src/ExCSS.Tests/PropertyTests/FlexPropertyTests.cs @@ -0,0 +1,30 @@ +using System.Linq; +using Xunit; + +namespace ExCSS.Tests.PropertyTests +{ + public class FlexPropertyTests + { + + [Fact] + public void JustifyAlign_Parses() + { + string css = """ +html { + justify-content: center; + align-items: center; + align-content: center; + align-self: center; +} +"""; + var stylesheet = new StylesheetParser().Parse(css); + + var info = stylesheet.StyleRules.First() as ExCSS.StyleRule; + + Assert.Equal(@"center", info.Style.AlignItems); + Assert.Equal(@"center", info.Style.AlignContent); + Assert.Equal(@"center", info.Style.AlignSelf); + Assert.Equal(@"center", info.Style.JustifyContent); + } + } +} diff --git a/src/ExCSS/StyleProperties/Flexbox/JustifyContentProperty.cs b/src/ExCSS/StyleProperties/Flexbox/JustifyContentProperty.cs index 82c076e5..44e8df4c 100644 --- a/src/ExCSS/StyleProperties/Flexbox/JustifyContentProperty.cs +++ b/src/ExCSS/StyleProperties/Flexbox/JustifyContentProperty.cs @@ -1,8 +1,9 @@ namespace ExCSS { - internal sealed class JustifyContentProperty : ShorthandProperty + internal sealed class JustifyContentProperty : Property { - private static readonly IValueConverter StyleConverter = Converters.JustifyContentConverter; + private static readonly IValueConverter StyleConverter = Converters.JustifyContentConverter + .OrDefault(Keywords.Normal); internal JustifyContentProperty() : base(PropertyNames.JustifyContent)