Skip to content

Commit

Permalink
Merge pull request #164 from LilithSilver/fix-justify-content
Browse files Browse the repository at this point in the history
Fix justify content incorrectly marked as shorthand
  • Loading branch information
TylerBrinks authored Sep 26, 2023
2 parents 1803173 + 7176838 commit 1b9ec50
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
30 changes: 30 additions & 0 deletions src/ExCSS.Tests/PropertyTests/FlexPropertyTests.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
5 changes: 3 additions & 2 deletions src/ExCSS/StyleProperties/Flexbox/JustifyContentProperty.cs
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 1b9ec50

Please sign in to comment.