Skip to content

Commit 12b0404

Browse files
committed
Docs updates
1 parent f9b18fc commit 12b0404

Some content is hidden

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

46 files changed

+151
-301
lines changed

docs/_content/SampleCore/altInstall1.html

-33
This file was deleted.

docs/_content/SampleCore/altInstall2.html

-16
This file was deleted.

docs/_content/SampleCore/compose1.html

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
<Styled @bind-Classname="@grey">
2-
label: white;
3-
background-color: white;
4-
</Styled>
5-
6-
<Styled @bind-Classname="@bigFont">
1+
<Styled @bind-Classname="@bigFont">
72
label: big-font;
83
font-size: 32px;
94
</Styled>
105

11-
<Styled @bind-Classname="@div" Compose1="@grey" Compose2="@bigFont" Compose2If="@_showBig" />
6+
<Styled @bind-Classname="@div" ComposeBigFont="@bigFont" ComposeBigFontIf="@_showBig">
7+
label: white;
8+
background-color: white;
9+
</Styled>
1210

1311
<div class="@div">
1412
Some text

docs/_content/SampleCore/install1.html

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
builder.RootComponents.Add<App>("app");
1010

11-
builder.RootComponents.Add<ClientSideStyled>("#styled");
12-
1311
await builder.Build().RunAsync();
1412
}
1513
}

docs/_content/SampleCore/install2.html

-14
This file was deleted.

docs/_content/SampleCore/install6.html

-19
This file was deleted.
+20-2
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,35 @@
11
@inject IStyled Styled
22

33
<Styled @bind-Classname="@example">
4-
color: {colors.primary};
4+
color: [colors.primary];
55
</Styled>
66

77
<p class="@example">Some text</p>
88

9+
<div>
10+
<button @onclick="@onclickRed">Change theme value to red</button>
11+
</div>
12+
13+
<div>
14+
<button @onclick="@onclickHotpink">Change theme value to hotpink</button>
15+
</div>
16+
917
@code {
1018
private string example;
1119

1220
protected override void OnInitialized()
1321
{
1422
//Normally this would be defined else where such as in MainLayout.cs
15-
Styled.Theme.Values.Add("colors.primary", "hotpink");
23+
Styled.SetThemeValue("colors.primary", "hotpink");
24+
}
25+
26+
private void onclickRed()
27+
{
28+
Styled.SetThemeValue("colors.primary", "red");
29+
}
30+
31+
private void onclickHotpink()
32+
{
33+
Styled.SetThemeValue("colors.primary", "hotpink");
1634
}
1735
}
0 Bytes
Binary file not shown.

docs/_framework/_bin/BlazorStyled.dll

16.5 KB
Binary file not shown.

docs/_framework/_bin/BlazorStyled.pdb

2.09 KB
Binary file not shown.
0 Bytes
Binary file not shown.
-512 Bytes
Binary file not shown.
-4 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

docs/_framework/_bin/SampleCore.dll

512 Bytes
Binary file not shown.

docs/_framework/_bin/SampleCore.pdb

328 Bytes
Binary file not shown.

docs/_framework/_bin/System.Core.dll

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.

docs/_framework/_bin/System.dll

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

docs/_framework/_bin/mscorlib.dll

0 Bytes
Binary file not shown.

src/Sample/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static async Task Main(string[] args)
1414
//Configure Services
1515

1616
//AddBlazorStyled is needed for BlazorStyled to work
17-
builder.Services.AddBlazorStyled(isDevelopment: false, isDebug: true);
17+
builder.Services.AddBlazorStyled(isDevelopment: false, isDebug: false);
1818

1919
//The following is only used by the sample sites and is not required for BlazorStyled to work
2020
builder.Services.AddServicesForSampleSites();

src/SampleCore/Pages/AltInstall.razor

-23
This file was deleted.

src/SampleCore/Pages/ClientSideUsage.razor

-37
This file was deleted.

src/SampleCore/Pages/Compose.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</p>
3535

3636
@code {
37-
private string div, grey, bigFont;
37+
private string div, bigFont;
3838
private bool _showBig = false;
3939

4040
private void onclick()

src/SampleCore/Pages/Install.razor

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
@page "/install"
2+
3+
<h1>Install</h1>
4+
5+
<h3>Install from Nuget</h3>
6+
7+
<p>Add a reference to BlazorStyled from Nuget: <a href="https://www.nuget.org/packages/BlazorStyled/"><img src="https://img.shields.io/nuget/vpre/BlazorStyled.svg" /></a></p>
8+
9+
<h3>Usage</h3>
10+
11+
<p>
12+
Add BlazorStyled to <code>Program.cs</code> (Client side blazor / WASM) or to your <code>Startup.cs</code> (Server side blazor).
13+
</p>
14+
15+
<PrettyCode CodeFile="_content/SampleCore/install1.html" HighlightLines="7" Title="Client Side - Program.cs" />
16+
17+
<PrettyCode CodeFile="_content/SampleCore/install5.html" HighlightLines="7" Title="Server side - Startup.cs" />
18+
19+
<p>Add the reference to the package to your <code>_Imports.razor</code> file:</p>
20+
21+
<PrettyCode CodeFile="_content/SampleCore/install3.html" HighlightLines="9" Title="_Imports.razor" />
22+
23+
<h3>Options</h3>
24+
25+
<p><code>AddBlazorStyled</code> has two options that can be useful during development:</p>
26+
27+
<table>
28+
<thead>
29+
<tr>
30+
<th>Option</th>
31+
<th>Default</th>
32+
<th>Description</th>
33+
</tr>
34+
</thead>
35+
<tbody>
36+
<tr>
37+
<td><code>isDevelopment</code></td>
38+
<td><code>false</code></td>
39+
<td>
40+
When <code>true</code>, css rules are written to the style tag in the head using <code>innerText</code>. This allows for editing of the rules in the javascript debugger. <br />
41+
When <code>false</code>, css rules are written to the style tag using <code>insertRule</code>. This slightly faster and prevents rules from being edited in the javascript debugger.
42+
</td>
43+
</tr>
44+
<tr>
45+
<td><code>isDebug</code></td>
46+
<td><code>false</code></td>
47+
<td>
48+
When <code>true</code>, debug info in outputted to the javascript console.
49+
</td>
50+
</tr>
51+
</tbody>
52+
</table>
53+
54+
<h3>API Usage</h3>
55+
56+
<p>
57+
Optionally, If you want to use the API (from a "code behind" for example), then inject <code>IStyled</code> into your component. If you are using
58+
the <code>&lt;Styled /></code> class, you do not need to inject <code>IStyled</code>
59+
</p>
60+
61+
<PrettyCode CodeFile="_content/SampleCore/install4.html" ShowLineNumbers="false" />

src/SampleCore/Pages/ServerSideUsage.razor

-45
This file was deleted.

0 commit comments

Comments
 (0)