-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support for generating an array of CSS classes for block, eleme…
…nt and modifier (#7) * 🆕 feat: Add CssProvider * update * remove debug code * refacotr a name of method * update * udpate version to 1.2.0
- Loading branch information
Showing
13 changed files
with
221 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ obj/ | |
/packages/ | ||
riderModule.iml | ||
/_ReSharper.Caches/ | ||
.idea/ | ||
.idea/ | ||
.vs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,42 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=3938f614_002D8c5b_002D4d0c_002D9317_002Dcc628d53109f/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="Block" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<TestAncestor>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.UnitTest1.Block</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.UnitTest1.Block</TestId>
 | ||
</TestAncestor>
 | ||
</SessionState></s:String> | ||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=3a528811_002D1ad3_002D4b36_002Dbd6b_002D4761f88f961e/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="All tests from &lt;BemIt.Tests&gt; #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<Project Location="F:\code\BemIt\BemIt.Tests" Presentation="&lt;BemIt.Tests&gt;" />
 | ||
</SessionState></s:String> | ||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=5b198ea2_002D635b_002D46f0_002Dbea1_002D7227609c93d5/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="Block_modifier_with_true_condition #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=5b198ea2_002D635b_002D46f0_002Dbea1_002D7227609c93d5/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="Block_modifier_with_true_condition #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<Or>
 | ||
<TestAncestor>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.BlockTests.Block_modifier_with_true_condition</TestId>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.ElementTests.Element_modifier</TestId>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.BlockTests.ChildBlock</TestId>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.ElementTests</TestId>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.ModifierTests.Modifier_with_true_condition</TestId>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.ModifierTests.Modifier_with_two_mods</TestId>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.ModifierTests.Modifier_three_withs</TestId>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.ModifierTests.Modifier_with_enum_with_one_mod</TestId>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.ModifierTests.Modifier_with_enum_with_multi</TestId>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.ModifierTests.Modifier_with_args_with_enum</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.BlockTests.Block_modifier_with_true_condition</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.ElementTests.Element_modifier</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.BlockTests.ChildBlock</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.ElementTests</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.ModifierTests.Modifier_with_true_condition</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.ModifierTests.Modifier_with_two_mods</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.ModifierTests.Modifier_three_withs</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.ModifierTests.Modifier_with_enum_with_one_mod</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.ModifierTests.Modifier_with_enum_with_multi</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.ModifierTests.Modifier_with_args_with_enum</TestId>
 | ||
</TestAncestor>
 | ||
<ProjectFile>F686E4F1-1AA0-4473-B7FB-F3654B7377E1/f:BlockTests.cs</ProjectFile>
 | ||
</Or>
 | ||
</SessionState></s:String> | ||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=608d3728_002Dfa3b_002D416d_002Dbccb_002D1f8d8412878b/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="Block_modifier_with_true_condition" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<TestAncestor>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.BlockTests.Block_modifier_with_true_condition</TestId>
 | ||
<TestId>xUnit::F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::BemIt.Tests.BlockTests.Block_modifier</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.BlockTests.Block_modifier_with_true_condition</TestId>
 | ||
<TestId>F686E4F1-1AA0-4473-B7FB-F3654B7377E1::net6.0::xUnit::BemIt.Tests.BlockTests.Block_modifier</TestId>
 | ||
</TestAncestor>
 | ||
</SessionState></s:String> | ||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=638b456a_002D975f_002D4204_002D9ead_002Da67e5256e5ab/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="All tests from &lt;BemIt.Tests&gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<Project Location="F:\code\BemIt\BemIt.Tests" Presentation="&lt;BemIt.Tests&gt;" />
 | ||
</SessionState></s:String> | ||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=ef8a8c4e_002D1ab0_002D4100_002D941d_002D1033707de375/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="All tests from UnitTest1.cs" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<ProjectFile>F686E4F1-1AA0-4473-B7FB-F3654B7377E1/f:UnitTest1.cs</ProjectFile>
 | ||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=ef8a8c4e_002D1ab0_002D4100_002D941d_002D1033707de375/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from UnitTest1.cs" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<Or>
 | ||
<ProjectFile>F686E4F1-1AA0-4473-B7FB-F3654B7377E1/f:BlockTests.cs</ProjectFile>
 | ||
<ProjectFile>F686E4F1-1AA0-4473-B7FB-F3654B7377E1/f:ElementTests.cs</ProjectFile>
 | ||
<ProjectFile>F686E4F1-1AA0-4473-B7FB-F3654B7377E1/f:ModifierTests.cs</ProjectFile>
 | ||
</Or>
 | ||
</SessionState></s:String></wpf:ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
namespace BemIt; | ||
using System.Collections.Generic; | ||
|
||
namespace BemIt; | ||
|
||
public interface IBem | ||
{ | ||
/// <summary> | ||
/// The name of the block or element | ||
/// </summary> | ||
string Name { get; } | ||
|
||
/// <summary> | ||
/// Adds original class names | ||
/// </summary> | ||
/// <param name="classNames">a single or a list of class names</param> | ||
/// <returns></returns> | ||
IBem AddClass(params string?[] classNames); | ||
|
||
/// <summary> | ||
/// Adds original class name if condition is true | ||
/// </summary> | ||
/// <param name="className">a single or a list of class names</param> | ||
/// <param name="condition"></param> | ||
/// <returns></returns> | ||
IBem AddClass(string className, bool condition); | ||
|
||
/// <summary> | ||
/// Generates a list of css classes | ||
/// </summary> | ||
/// <returns></returns> | ||
IEnumerable<string> GenerateCssClasses(); | ||
|
||
/// <summary> | ||
/// Builds the css class | ||
/// </summary> | ||
/// <returns></returns> | ||
string Build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace BemIt; | ||
|
||
public interface IBlockOrElement: IBem | ||
public interface IBlockOrElement | ||
{ | ||
string Name { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.