Skip to content

Commit 8435d7b

Browse files
committed
chore: Init repository
0 parents  commit 8435d7b

File tree

75 files changed

+61949
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+61949
-0
lines changed

.editorconfig

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
[*.csproj]
2+
indent_style = space
3+
indent_size = 2
4+
[*.{cs,vb}]
5+
indent_style = space
6+
indent_size = 4
7+
#### Naming styles ####
8+
9+
# Naming rules
10+
11+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
12+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
13+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
14+
15+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
16+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
17+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
18+
19+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
20+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
21+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
22+
23+
# Symbol specifications
24+
25+
dotnet_naming_symbols.interface.applicable_kinds = interface
26+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
27+
dotnet_naming_symbols.interface.required_modifiers =
28+
29+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
30+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
31+
dotnet_naming_symbols.types.required_modifiers =
32+
33+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
34+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
35+
dotnet_naming_symbols.non_field_members.required_modifiers =
36+
37+
# Naming styles
38+
39+
dotnet_naming_style.begins_with_i.required_prefix = I
40+
dotnet_naming_style.begins_with_i.required_suffix =
41+
dotnet_naming_style.begins_with_i.word_separator =
42+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
43+
44+
dotnet_naming_style.pascal_case.required_prefix =
45+
dotnet_naming_style.pascal_case.required_suffix =
46+
dotnet_naming_style.pascal_case.word_separator =
47+
dotnet_naming_style.pascal_case.capitalization = pascal_case
48+
49+
dotnet_naming_style.pascal_case.required_prefix =
50+
dotnet_naming_style.pascal_case.required_suffix =
51+
dotnet_naming_style.pascal_case.word_separator =
52+
dotnet_naming_style.pascal_case.capitalization = pascal_case
53+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
54+
tab_width = 4
55+
indent_size = 4
56+
end_of_line = crlf
57+
dotnet_style_coalesce_expression = true:suggestion
58+
dotnet_style_null_propagation = true:suggestion
59+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
60+
dotnet_style_prefer_auto_properties = true:silent
61+
dotnet_style_object_initializer = true:suggestion
62+
dotnet_style_collection_initializer = true:suggestion
63+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
64+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
65+
dotnet_style_prefer_conditional_expression_over_return = true:silent
66+
dotnet_style_explicit_tuple_names = true:suggestion
67+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
68+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
69+
dotnet_style_prefer_compound_assignment = true:suggestion
70+
dotnet_style_prefer_simplified_interpolation = true:suggestion
71+
dotnet_style_namespace_match_folder = true:suggestion
72+
dotnet_style_readonly_field = true:suggestion
73+
dotnet_style_qualification_for_field = true:warning
74+
dotnet_style_qualification_for_property = true:warning
75+
dotnet_style_qualification_for_method = true:warning
76+
dotnet_style_qualification_for_event = true:warning
77+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
78+
dotnet_style_predefined_type_for_member_access = true:silent
79+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
80+
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
81+
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
82+
dotnet_code_quality_unused_parameters = all:suggestion
83+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
84+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
85+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
86+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
87+
88+
[*.cs]
89+
csharp_indent_labels = one_less_than_current
90+
csharp_space_around_binary_operators = before_and_after
91+
csharp_using_directive_placement = outside_namespace:silent
92+
csharp_prefer_simple_using_statement = true:suggestion
93+
csharp_prefer_braces = true:silent
94+
csharp_style_namespace_declarations = file_scoped:suggestion
95+
csharp_style_prefer_method_group_conversion = true:silent
96+
csharp_style_expression_bodied_methods = false:silent
97+
csharp_style_expression_bodied_constructors = false:silent
98+
csharp_style_expression_bodied_operators = false:silent
99+
csharp_style_expression_bodied_properties = true:silent
100+
csharp_style_expression_bodied_indexers = true:silent
101+
csharp_style_expression_bodied_accessors = true:silent
102+
csharp_style_expression_bodied_lambdas = true:silent
103+
csharp_style_expression_bodied_local_functions = false:silent
104+
csharp_style_throw_expression = true:suggestion
105+
csharp_style_prefer_null_check_over_type_check = true:suggestion
106+
csharp_prefer_simple_default_expression = true:suggestion
107+
csharp_style_prefer_local_over_anonymous_function = true:suggestion
108+
csharp_style_prefer_index_operator = true:suggestion
109+
csharp_style_prefer_range_operator = true:suggestion
110+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
111+
csharp_style_prefer_tuple_swap = true:suggestion
112+
csharp_style_inlined_variable_declaration = true:suggestion
113+
csharp_style_deconstructed_variable_declaration = true:suggestion
114+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
115+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
116+
csharp_prefer_static_local_function = true:suggestion
117+
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
118+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
119+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
120+
csharp_style_conditional_delegate_call = true:suggestion
121+
csharp_style_prefer_parameter_null_checking = true:suggestion
122+
csharp_style_prefer_switch_expression = true:suggestion
123+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
124+
csharp_style_prefer_pattern_matching = true:silent
125+
csharp_style_prefer_not_pattern = true:suggestion
126+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
127+
csharp_style_prefer_extended_property_pattern = true:suggestion
128+
csharp_style_var_for_built_in_types = true:warning
129+
csharp_style_var_when_type_is_apparent = true:warning
130+
csharp_style_var_elsewhere = true:warning

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
bin/
2+
obj/
3+
.vs/
4+
.vscode/
5+
*.user
6+
*.suo
7+
*.nupkg
8+
.DS_Store
9+
*.log
10+
*.vsix
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<RootNamespace>DotnetDevKR.TailwindCSS</RootNamespace>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<WarningsAsErrors>$(WarningsAsErrors);nullable</WarningsAsErrors>
9+
<Nullable>enable</Nullable>
10+
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
11+
</PropertyGroup>
12+
</Project>
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
using System;
2+
using System.Diagnostics;
3+
using System.IO;
4+
using System.Runtime.InteropServices;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace DotnetDevKR.TailwindCSS;
9+
10+
public class TailwindCSSCompiler
11+
{
12+
public async Task CompileAsync(
13+
string MSBuildThisFileDirectory,
14+
string InputFilename,
15+
string OutputFilename,
16+
string ProjectDir,
17+
bool isMinify = false,
18+
bool isDebug = false,
19+
bool watch = false
20+
)
21+
{
22+
var process = CreateTailwindCSSProcess(
23+
MSBuildThisFileDirectory,
24+
$"-i {InputFilename} -o {OutputFilename} --cwd {ProjectDir}" +
25+
(isMinify ? " --minify" : "") +
26+
(isDebug ? " --map" : "") +
27+
(watch ? " --watch" : "")
28+
);
29+
30+
var errorOutput = new MemoryStream();
31+
32+
process.Start();
33+
var outputTask = process.StandardOutput.BaseStream.CopyToAsync(Stream.Null);
34+
var errorTask = process.StandardError.BaseStream.CopyToAsync(errorOutput);
35+
await Task.WhenAll(outputTask, errorTask, process.WaitForExitAsync());
36+
37+
if (process.ExitCode != 0)
38+
{
39+
var errorOutputText = Encoding.UTF8.GetString(errorOutput.ToArray());
40+
throw new Exception($"TailwindCSS process exited with non-zero exit code: {process.ExitCode}. Output: {errorOutputText}");
41+
}
42+
43+
process.Dispose();
44+
}
45+
46+
internal static Process CreateTailwindCSSProcess(string MSBuildThisFileDirectory, string arguments)
47+
{
48+
Console.WriteLine($"Executing Tailwind CSS with arguments: {arguments}");
49+
var executablePath = GetExecutablePath();
50+
if (executablePath is null)
51+
{
52+
throw new Exception("Tailwind CSS executable not found for current OS platform and architecture.");
53+
}
54+
var process = new Process();
55+
process.StartInfo.FileName = Path.Combine(MSBuildThisFileDirectory, executablePath);
56+
process.StartInfo.Arguments = arguments;
57+
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
58+
process.StartInfo.CreateNoWindow = true;
59+
process.StartInfo.UseShellExecute = false;
60+
process.StartInfo.RedirectStandardOutput = true;
61+
process.StartInfo.RedirectStandardError = true;
62+
process.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
63+
64+
return process;
65+
}
66+
internal static string? GetExecutablePath()
67+
{
68+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
69+
{
70+
return RuntimeInformation.OSArchitecture switch
71+
{
72+
Architecture.X64 => "runtime\\tailwindcss-windows-x64.exe",
73+
Architecture.Arm64 => "runtime\\tailwindcss-windows-arm64.exe",
74+
_ => null,
75+
};
76+
}
77+
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
78+
{
79+
return RuntimeInformation.OSArchitecture switch
80+
{
81+
Architecture.X64 => "runtime/tailwindcss-linux-x64",
82+
Architecture.Arm64 => "runtime/tailwindcss-linux-arm64",
83+
_ => null,
84+
};
85+
}
86+
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
87+
{
88+
return RuntimeInformation.OSArchitecture switch
89+
{
90+
Architecture.X64 => "runtime/tailwindcss-macos-x64",
91+
Architecture.Arm64 => "runtime/tailwindcss-macos-arm64",
92+
_ => null,
93+
};
94+
}
95+
96+
return null;
97+
}
98+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Router AppAssembly="@typeof(App).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
5+
</Found>
6+
<NotFound>
7+
<PageTitle>Not found</PageTitle>
8+
<LayoutView Layout="@typeof(MainLayout)">
9+
<p role="alert">Sorry, there's nothing at this address.</p>
10+
</LayoutView>
11+
</NotFound>
12+
</Router>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.7" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.7" PrivateAssets="all" />
12+
<PackageReference Include="DotnetDevKR.TailwindCSS" Version="0.0.1" />
13+
</ItemGroup>
14+
15+
<Target Name="Configure" BeforeTargets="RunTailwindCSSTask">
16+
<PropertyGroup>
17+
<InputFilename>$(ProjectDir)tailwind.css</InputFilename>
18+
<OutputFilename>wwwroot\css\app.css</OutputFilename>
19+
<IsMinify>false</IsMinify>
20+
<DebugMode>true</DebugMode>
21+
</PropertyGroup>
22+
</Target>
23+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@inherits LayoutComponentBase
2+
<div class="page">
3+
<div class="sidebar">
4+
<NavMenu />
5+
</div>
6+
7+
<main>
8+
<div class="top-row px-4">
9+
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
10+
</div>
11+
12+
<article class="content px-4">
13+
@Body
14+
</article>
15+
</main>
16+
</div>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
.page {
2+
position: relative;
3+
display: flex;
4+
flex-direction: column;
5+
}
6+
7+
main {
8+
flex: 1;
9+
}
10+
11+
.sidebar {
12+
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
13+
}
14+
15+
.top-row {
16+
background-color: #f7f7f7;
17+
border-bottom: 1px solid #d6d5d5;
18+
justify-content: flex-end;
19+
height: 3.5rem;
20+
display: flex;
21+
align-items: center;
22+
}
23+
24+
.top-row ::deep a, .top-row ::deep .btn-link {
25+
white-space: nowrap;
26+
margin-left: 1.5rem;
27+
text-decoration: none;
28+
}
29+
30+
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31+
text-decoration: underline;
32+
}
33+
34+
.top-row ::deep a:first-child {
35+
overflow: hidden;
36+
text-overflow: ellipsis;
37+
}
38+
39+
@media (max-width: 640.98px) {
40+
.top-row {
41+
justify-content: space-between;
42+
}
43+
44+
.top-row ::deep a, .top-row ::deep .btn-link {
45+
margin-left: 0;
46+
}
47+
}
48+
49+
@media (min-width: 641px) {
50+
.page {
51+
flex-direction: row;
52+
}
53+
54+
.sidebar {
55+
width: 250px;
56+
height: 100vh;
57+
position: sticky;
58+
top: 0;
59+
}
60+
61+
.top-row {
62+
position: sticky;
63+
top: 0;
64+
z-index: 1;
65+
}
66+
67+
.top-row.auth ::deep a:first-child {
68+
flex: 1;
69+
text-align: right;
70+
width: 0;
71+
}
72+
73+
.top-row, article {
74+
padding-left: 2rem !important;
75+
padding-right: 1.5rem !important;
76+
}
77+
}

0 commit comments

Comments
 (0)