Skip to content

Commit 48b3883

Browse files
committed
Add BrowserStyle.css
1 parent eefbccf commit 48b3883

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ There are 4 files:
1313
- `Style.css`: Your custom CSS code to insert
1414

1515
Write your Steam installation path in `SteamPath.txt` and custom CSS code in `Style.css`.
16+
Optionally, you can create an extra `BrowserStyle.css` file. This style will be inserted to Steam Browser styles in replace of `Style.css`.
1617

1718
Start `SteamCSS.exe` to run the program.
1819

README.zh-CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- `Style.css`: 自定义要插入的 CSS 代码
1414

1515
先在 `SteamPath.txt` 里写下 Steam 的安装文件夹, `Style.css` 里写下要插入的 CSS 代码.
16+
另外也可以再新建一个 `BrowserStyle.css` 文件, 这个样式可以替代 `Style.css` 插入到 Steam 内置浏览器的样式中.
1617

1718
然后启动 `SteamCSS.exe` 就可以了.
1819

SteamCSS/Program.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,18 @@ static void Main()
3737
try
3838
{
3939
var steamPath = File.ReadAllText("SteamPath.txt").Trim();
40-
var style = File.ReadAllText("Style.css");
40+
var mainStyle = File.ReadAllText("Style.css");
41+
42+
var browserStyle = "";
43+
if (File.Exists("BrowserStyle.css"))
44+
{
45+
browserStyle = File.ReadAllText("BrowserStyle.css");
46+
}
47+
else
48+
{
49+
browserStyle = mainStyle;
50+
}
51+
4152
var cssFiles = File.ReadAllText("StylePath.txt").Trim().Split(new string [] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList();
4253
var processedFiles = new List<string>();
4354
cssFiles.ForEach(file =>
@@ -48,6 +59,7 @@ static void Main()
4859
return;
4960
}
5061
var content = File.ReadAllText(filePath);
62+
var style = file.Contains("webkit") ? browserStyle : mainStyle;
5163
if (!content.StartsWith(style))
5264
{
5365
File.WriteAllText(filePath, style + Environment.NewLine + content);

SteamCSS/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
3333
//通过使用 "*",如下所示:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.1.0")]
36-
[assembly: AssemblyFileVersion("1.0.1.0")]
35+
[assembly: AssemblyVersion("1.1.0.0")]
36+
[assembly: AssemblyFileVersion("1.1.0.0")]

0 commit comments

Comments
 (0)