-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add setting to include html comment with icon info
- Loading branch information
Showing
9 changed files
with
151 additions
and
8 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
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,4 +1,7 @@ | ||
{ | ||
"Heroicons": { | ||
"IncludeComments": true | ||
}, | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
|
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,10 +1,10 @@ | ||
{ | ||
"AllowedHosts": "*", | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft": "Warning", | ||
"Microsoft.Hosting.Lifetime": "Information" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Tailwind.Heroicons | ||
{ | ||
public class HeroiconOptions | ||
{ | ||
/// <summary> | ||
/// Add an html comment before the svg tag with the style and name of the icon. | ||
/// </summary> | ||
/// <remarks>This is off by default.</remarks> | ||
public bool IncludeComments { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
namespace Microsoft.Extensions.DependencyInjection | ||
{ | ||
using System; | ||
|
||
using Microsoft.Extensions.Configuration; | ||
|
||
using Tailwind.Heroicons; | ||
|
||
public static class HeroiconsExtensions | ||
{ | ||
public static IServiceCollection AddHeroicons(this IServiceCollection services, IConfiguration configuration) | ||
{ | ||
if (services is null) throw new ArgumentNullException(nameof(services)); | ||
if (configuration is null) throw new ArgumentNullException(nameof(configuration)); | ||
|
||
services.Configure<HeroiconOptions>(configuration.GetSection("Heroicons")); | ||
|
||
return services; | ||
} | ||
|
||
public static IServiceCollection AddHeroicons(this IServiceCollection services, Action<HeroiconOptions> configureOptions) | ||
{ | ||
if (services is null) throw new ArgumentNullException(nameof(services)); | ||
if (configureOptions is null) throw new ArgumentNullException(nameof(configureOptions)); | ||
|
||
services.Configure(configureOptions); | ||
|
||
return services; | ||
} | ||
} | ||
} |
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