Giter Site home page Giter Site logo

libsassbuilder's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

libsassbuilder's Issues

Linux Support

Would it be possible to add support for Linux?

Thanks

Generates file perfectly, but cannot access in Blazor WASM

The file /Client/Styles/app.scss (and others) eventually generate a /Client/Styles/app.css file. This is perfect. However, in Blazor, there is a /Client/wwwroot/index.html file that is the basis of the entire site/html. It needs the files to be within that /Client/wwwroot or below.

So is there a way to copy the generated .css file to the wwwroot somewhere?
Or perhaps to directly generate the file to somewhere in or below the wwwroot folder?

Not working in Jetbrains Rider

Hi first thank for creating this project. Really appreciate not having node in my Blazor project.

LSB works when used with with VS 2019. But the build task is not running when I use Jetbrains Rider.
Do you know why?

A side note. Put this code in the readme file. Easy way to copy the output file to WWW

<Target Name="CopyStyles" AfterTargets="AfterCompile"> <Copy SourceFiles="$(MSBuildProjectDirectory)\Styles\styles.css" DestinationFolder="$(MSBuildProjectDirectory)\wwwroot\css" /> <Message Importance="high" Text="Copying the minified build styles to WWWROOT" /> </Target>

Setting file encoding

Hi!

For some reason the generated .css file is in a weird encoding (CP1252) which is not supported by an IDE we want to switch to.
Is there any setting or something that we can set to choose the file-encoding used?

We want UTF-8 on all of our files.

Sass compilation not finished when moving to next build step?

I am using the latest version of Maui on Windows 10.

This is what I am seeing:

  • I add LibSassBuilder to the project using NuGet
  • I have a bunch of razor components with a local SCSS file along with a couple of global SCSS files
  • When I run the project for the first time the styling is messed up, looking in the debugger shows the style sheets were not included
  • Running the app again (without making any changes) shows the styling as expected.

It looks like the first time when the sass compiler needs to compile lots of files it moves to the next step (which bundles all CSS files together) before it was actually completed. The end result is missing styles.

Am I doing something wrong? Maybe I missed some configuration? Any help would be greatly appreciated!

Directory command: problem with excluded directories

We are using the directory option for SCSS compilation. The documentation mentions that files in four directories get excluded from the compilation by default in this case, see here: https://github.com/johan-v-r/LibSassBuilder/blob/main/README.md#directory-command-default

That is unfortunately not the whole truth as we had to discover. We observed that some SCSS files in our solution were not compiled while others were. Digging through the source code revealed the reason for this behavior:

if (excludedDirectories.Any(dir => subDirectory.EndsWith(dir, StringComparison.OrdinalIgnoreCase)))

The exclusion check does not take into account the whole folder name, instead it tests if it ends with one of the excluded folder names. In our case the SCSS files were in a folder named Dialogs (ending with logs) and therefore were excluded from the compilation process.

I don't know if testing with EndsWith is the desired behavior, but I think one of the following two options should be implemented:

  1. Update the README.md to point out this behavior.
  2. Replace EndsWith to take the whole directory name into account.

Automatically creating ItemGroup/Include references with new files.

Maybe I'm doing something wrong, but I have fiddled for a bit and can't stop it from happening.

I took the settings straight from the README.MD
Is there something I am doing wrong, or is this a bug?

Varsion: Visual Studio 2022
Project Type: Blazor WASM Hosted

<PropertyGroup>
  <!-- take full-control -->
  <EnableDefaultSassItems>false</EnableDefaultSassItems>
</PropertyGroup>

<ItemGroup>
  <!-- add files manually -->
  <SassFile Include="wwwroot/css/app.scss; **/*.razor.scss" Exclude="Styles/**/*.scss; Styles/*.scss"/>
</ItemGroup

After adding a new file into the 'Styles' folder. An Include item group is added for the scss file.

<ItemGroup>
   <SassFile Include="Styles\StyleSheet.scss" />
</ItemGroup>

Run manually via dotnet / console

Is it possible to run the nuget package manually in the console outside of dotnet build? For example rebuilding the sass files while debugging?

Option to exclude folders

Hello. Great tool!

But I can't use it because it keeps compiling my node_modules folder. I've been looking into the source and it has no options to exclude folders.

Regards.

Build failed with NET6

Good morning,

we migrated our Blazor WASM project to .NET 6 and now we are not able to compile anymore.
It seems that this library asks to use .NET 5 SDK instead of .NET 6 one.

Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored D:\Projects\my-project\MyProject.GUI\MyProject.GUI.csproj (in 651 ms).
  It was not possible to find any compatible framework version
  The framework 'Microsoft.NETCore.App', version '5.0.0' (x64) was not found.
    - The following frameworks were found:
        3.1.16 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
        3.1.18 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
        3.1.19 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
        3.1.20 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
        6.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

  You can resolve the problem by installing the specified framework and/or SDK.

  The specified framework can be found at:
    - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x64&rid=win10-x64
C:\Users\enricobenedos\.nuget\packages\libsassbuilder\1.6.4\build\LibSassBuilder.targets(90,5): error MSB3073: The command "dotnet "C:\Users\enricobenedos\.nuget\packages\libsassbuilder\1.6.4\build\../tool/LibSassBuilder.dll" files "D:\Projects\my-project\MyProject.GUI\wwwroot\css\app.scss" "D:\Projects\my-project\MyProject.GUI\wwwroot\css\variables.scss" --outputstyle compressed --level default " exited with code -2147450730. [D:\Projects\my-project\MyProject.GUI\MyProject.GUI.csproj]

Thanks

Plans for NET7 support

Hi @johan-v-r !

First of all thanks for your lib ;)
As for the .Net 7 support event if it's still in preview, do you plan to migrate yourself ?

Could we create a 'preview' of LibSassBuilder with NET7 support ?
If you want I can initiate a new PR for this.

Thanks !

Any way to get LibSassBuilder to work on the M1 processor?

Heya, I upgraded to an M1 processor, and now I'm getting build errors.
/Users/jost/.nuget/packages/libsassbuilder/1.6.4/build/LibSassBuilder.targets(90,5): error MSB3073: The command "dotnet "/Users/jost/.nuget/packages/libsassbuilder/1.6.4/build/../tool/LibSassBuilder.dll" files "/Users/jost/Desktop/FT/ver/ver-self-service-portal/src/FaroeseTelecom.Ver.Web/wwwroot/css/styles.scss" --outputstyle expanded --level verbose " exited with code 130. [/Users/jost/Desktop/FT/ver/ver-self-service-portal/src/FaroeseTelecom.Ver.Web/FaroeseTelecom.Ver.Web.csproj]

I am currently running libsassbuilder 1.6.4. I found that I can upgrade, but then I'm simply told that libsasshost does not support the arm64 architecture.

I have tried a million different combinations (such as this dotnet/sdk thread), but to no avail

Do you know of a way? :)

Do not override if only white space (or EOL) changes

Using Git & Visual Studio, it happens often when changing branches that css files are re-generated even if only white space or end-of-line changes are found.
It is kind of anoying when you combine with git use, as it finds modified files when it is actalluy the same.
Is there a way to avoid this behavior? And if not, would it be possible to implement an option for this?

LibSass run on Save

Hi, is there an option to run LibSass on save and not just on build?

What I am wanting to do is get LibSass to convert scss files to css files whenever I save a file. This would allow Blazor to hotreload the page as I expect once the css file changes. Any help here would be appreciated, thanks!

Imports relative to project root

Hey, just started using this in a Blazor webassembly app. Working great, but when I want to import a another file for variables it doesn't work out too well. I have color variables in a top level folder which will be needed many places, and I would like to import relative to project root. This worked with the Delegate.SassBuilder project (@import 'wwwroot/variables.scss';), but since this library seems actively maintained and well designed I have switched to this library. Is there a way to do imports relative to project root currently? I.e.

  • @import 'wwwroot/variables.scss';
  • @import '/wwwroot/variables.scss';
  • @import '~/wwwroot/variables.scss';

Support for include-path (or equivalent) parameter

I have my own SCSS files that import from various packages found under node_modules. For example,

site.scss

...
@import 'bootstrap/scss/_variables';
@import 'bootstrap/scss/_mixins';
@import 'bootstrap/scss/_reboot';
...

When I currently execute npm run node-sass, I include the --include-path node_modules argument so the imports can be found. Does your LibSassBuilder tool have an equivalent option or do all imports need to be explicitly pathed?

Plans for supporting arm64 architecture on macOS (i.e. Apple M1 CPUs)?

Hi @johan-v-r - thanks a lot for this great lib.
It has helped us many times. Before some of us moved to the M1 ๐Ÿ˜…

When trying to use the tool e.g. as a global dotnet tool, we get this error:

โžœ  Client git:(net60) lsb directory .
Sass compile directory: .
Unhandled exception. LibSassHost.SassCompilerLoadException: During loading of Sass compiler error has occurred. Most likely it happened, because the 'libsass.dylib' assembly or one of its dependencies was not found. There is no LibSassHost.Native.osx-* package for the arm64 processor architecture. You can build the 'libsass.dylib' assembly for the current processor architecture by using following instructions - https://github.com/Taritsyn/LibSassHost#os-x-1. ---> System.DllNotFoundException: Unable to load shared library 'libsass' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibsass, 0x0001): tried: 'liblibsass' (no such file), '/usr/local/lib/liblibsass' (no such file), '/usr/lib/liblibsass' (no such file), '/Users/christianweyer/Sources/blazor-wasm-things-to-know/IsolatedCssSass/Client/liblibsass' (no such file), '/usr/local/lib/liblibsass' (no such file), '/usr/lib/liblibsass' (no such file)
   at LibSassHost.Internal.Native.Sass_Api.libsass_version()
   at LibSassHost.Internal.SassCompilerProxy.GetVersion()
   at LibSassHost.SassCompiler.Initialize()
   at LibSassHost.SassCompiler.Initialize()
   at LibSassHost.SassCompiler.CompileFile(String inputPath, String outputPath, String sourceMapPath, CompilationOptions options)
   at LibSassBuilder.Program.CompileFilesAsync(IEnumerable`1 sassFiles) in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 93
   at LibSassBuilder.Program.CompileDirectoriesAsync(String directory, IEnumerable`1 excludedDirectories) in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 67
   at LibSassBuilder.Program.CompileDirectoriesAsync(String directory, IEnumerable`1 excludedDirectories) in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 76
   at LibSassBuilder.Program.<>c.<<Main>b__0_2>d.MoveNext() in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 34
--- End of stack trace from previous location ---
   at CommandLine.ParserResultExtensions.WithParsedAsync[T](ParserResult`1 result, Func`2 action)
   at LibSassBuilder.Program.Main(String[] args) in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 22
   at LibSassBuilder.Program.<Main>(String[] args)

[1]    41974 abort      lsb directory .

Are you planning to include arm64 support anytime soon?
Thanks!

Installing LibSassBuilder hides SCSS files from the solution explorer in Rider

As the title says my SCSS files disappear in the solution explorer of Jetbrains Rider when I install this library.
I can still see the files in Windows Explorer and they also get compiled when building the project.
Uninstalling the library makes the files re-appear.

Do you have any idea why this is happening?

SCSS files get excluded by default when added through Visual Studio

Firstly, I just want to say that this is a great tool and it's worked for me where others have failed - so thank you for providing this for us all to use!

I have 2 issues with it which I'm hoping you can help with. I'll describe these separately - the first issue is how SCSS files seem to get excluded by default, and I'm not sure why this is happening or what's causing it. This is happening in a Blazor project of mine, but I've tried in a simple console application too and the same thing happens. This is happening in Visual Studio so I don't know if this is interfering somehow. These are the repro steps:

Visual Studio 2019, version 16.9.0.
LibSassBuilder 1.6.1.

  1. Create a new C# console application in Visual Studio - choose .NET 5.0 as the target framework.
  2. Add the LibSassBuilder NuGet package to the project.
  3. In Solution Explorer, right-click on the project, choose Add > New Item, and add a new SCSS style sheet, e.g. StyleSheet1.scss.
  4. Build the solution, and note that the CSS does NOT get generated.
  5. Furthermore, right-click on the project in Solution Explorer and choose 'Edit Project File'. Note that the following elements have been automatically added:
  <ItemGroup>
    <SassFile Remove="StyleSheet1.scss" />
  </ItemGroup>
  1. Remove these offending elements.
  2. Build the solution and note that the CSS is now generated correctly.

This happens every time I add a new SCSS file, which is quite irritating as every time I have to go and manually remove this element from the .csproj file.

I hope you can help me to understand why this is happening.

Disable SCSS compilation inside docker

Hi, I get the following error during my docker multi-build arm64 stage.

There is no LibSassHost.Native.linux-* package for the arm64 processor architecture

Since I include the generated css files in the repo, I was thinking it's actually not needed to run the SCSS compilation during server build (done in Docker). Is there a way to do that?

Generate .map files

Using the standard sass compiler doesn't just produce a .css output but also a .map file that allows mapping to scss files when debugging in the browser. Are there any plans to add such an option here?

EnableDefaultSassItems - Throwing Exceptions and Stopping Build

Hi,

New to the library and attempting to use this on a DOTNET 5 Blazor WASM app. Everything is okay but as soon as I try and use EnableDefaultSassItems, I get issues.

Environment

Windows 10 21H1 (19043)
Visual Studio 2019 (v 16.11.5)
Blazor WASM NET5 (NETCORE 3.1)
LibSassBuilder Version 1.6.4

Issue

If I have the following in my CSPROJ, I randomly get build exceptions

<PropertyGroup>
    <!--outputstyle option-->
    <LibSassOutputStyle>compressed</LibSassOutputStyle>
    <LibSassOutputStyle Condition="'$(Configuration)' == 'Debug'">expanded</LibSassOutputStyle>
    <!--level option-->
    <LibSassOutputLevel>verbose</LibSassOutputLevel>
    <!--msbuild output level-->
    <LibSassMessageLevel>High</LibSassMessageLevel>
    <EnableDefaultSassItems>false</EnableDefaultSassItems>
  </PropertyGroup>

  <ItemGroup>
    <!--add files manually-->
    <SassFile Include="Pages/**/*.scss"/>
    <!--<SassFile Include="wwwroot/**"/>-->
  </ItemGroup>

And I get the following in the "Build -> Output"

LibSassBuilder 1.6.3
Copyright (C) 2021 Johan van Rensburg

ERROR(S):
 A required value not bound to option name is missing.

 -l, --level      Specify the level of output (silent, default, verbose)

 --outputstyle    Specify the style of output (compressed, condensed, nested,
                   expanded)

  --help           Display this help screen.

  --version        Display version information.

  value pos. 0     Required. File(s) to process

C:\Users\[username]\.nuget\packages\libsassbuilder\1.6.4\build\LibSassBuilder.targets(90,5): error MSB3073: The command "dotnet "C:\Users\[username]\.nuget\packages\libsassbuilder\1.6.4\build\../tool/LibSassBuilder.dll" files  --outputstyle expanded --level verbose " exited with code 1.

As soon as I remove the <EnableDefaultSassItems>false</EnableDefaultSassItems> the project builds again without issue (note it does correctly build/process scss files when this is removed). On my main project where I first noticed this issue, I did find that sometimes the issue only appears when I clean/rebuild. Therefore, to ensure this is not something specific to this project, I have created another simple project and have been able to replicate the issue on that as well.

I hope this makes sense, I need to use this as I am needing to ignore some of the "Vendor" scss files and the simplest way was to create an "allowed list".

I do note that the Build Output does say that I am using LibSassBuilder 1.6.3, I don't have that installed (only started using this library a couple of days ago) so is there any chance there is a dll/version mismatch somewhere?

Another random thing I have noticed is that I have to include <None Include="**/*.scss" /> when using <EnableDefaultSassItems>false</EnableDefaultSassItems> or the SASS files disappear. Not sure if that helps narrow anything down, I believe #15 & #27 mentions this had been fixed/wasn't needed anymore.

I hope this makes sense, let me know if you need anything further. Hopefully, I am not being thick and just have missed something/haven't implemented it correctly. Thanks in advance.

Set IncludePaths via project property

I'd like to include scss files from a particular library (Bootstrap) without having to reference the relative path to the files. If we were able to set the IncludePaths CompilationOption, then I could add the path to the library folder as a search path.

This would change:

@import "../lib/twitter-bootstrap/css/functions";

to

@import "functions";

The csproj config would look like:

  <PropertyGroup>
    <LibSassIncludePaths Include="/lib/twitter-bootstrap/css/"></LibSassIncludePaths>
  </PropertyGroup>

2.0.3 build fails on Ubuntu - tool/LibSassBuilder: not found

We have a .NET 6 project that is build on both Windows and Ubuntu agents in Azure Devops.
On updating from 2.0.2 to 2.0.3 the windows build is fine while the ubuntu build now fails:

/usr/bin/sh: 2: /tmp/MSBuildTempvsts/tmp58991d4476b74471866cdfb25fa0278f.exec.cmd: /home/vsts/.nuget/packages/libsassbuilder/2.0.3/build/../tool/LibSassBuilder: not found
##[error]/home/vsts/.nuget/packages/libsassbuilder/2.0.3/build/LibSassBuilder.targets(95,5): Error MSB3073: The command ""/home/vsts/.nuget/packages/libsassbuilder/2.0.3/build/../tool/LibSassBuilder" files "[a series of .scss files]" --outputstyle compressed --level default " exited with code 127.
/home/vsts/.nuget/packages/libsassbuilder/2.0.3/build/LibSassBuilder.targets(95,5): error MSB3073: The command ""/home/vsts/.nuget/packages/libsassbuilder/2.0.3/build/../tool/LibSassBuilder" files "[a series of .scss files]" --outputstyle compressed --level default " exited with code 127.

I assume this is due to changes in #41

Blazor app archiving fail

Hello,

currently working on a blazor WASM mobile app, I'm stuck on archiving process with the following output (and nothing more, the build process works fine) :

The "Sass" rule is missing the "{ItemType}" property. Failed to create App archive 'Mobile'.

I target the net6.0-android framework, and work with the last version of VisualStudio 2022

The problem occurs only when I attempt to publish from my Visual Studio, the devops pipeline works fine.

There is not any archiving issue when removing the libsassbuilder from the projet.

Out of ideas to resolve this, and I can't figure out if I miss some configuration or details, or if there is some incompatibility between LibSassBuilder and blazor WASM for mobile.

The process cannot access CSS file on build

Thanks for the great tool!

I receive often the following error on Visual Studio project rebuild:

1>Sass compile files
1>Sass compile files
1>Unhandled exception. System.IO.IOException: The process cannot access the file 'C:\Users\vladi\OneDrive\Documents\GitHub\blazor.radzen.com\Radzen.Blazor\themes\dark-base.css' because it is being used by another process.
1>   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
1>   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
1>   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
1>   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
1>   at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
1>   at System.IO.File.AsyncStreamReader(String path, Encoding encoding)
1>   at System.IO.File.InternalReadAllTextAsync(String path, Encoding encoding, CancellationToken cancellationToken)
1>   at LibSassBuilder.Program.CompileFilesAsync(IEnumerable`1 sassFiles) in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 97
1>   at LibSassBuilder.Program.<>c.<<Main>b__0_2>d.MoveNext() in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 44
1>--- End of stack trace from previous location ---
1>   at CommandLine.ParserResultExtensions.WithParsedAsync[T](ParserResult`1 result, Func`2 action)
1>   at LibSassBuilder.Program.Main(String[] args) in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 22
1>   at LibSassBuilder.Program.<Main>(String[] args)
1>Sass files compiled
1>C:\Users\vladi\.nuget\packages\libsassbuilder\2.0.1\build\LibSassBuilder.targets(95,5): error MSB3073: The command "dotnet "C:\Users\vladi\.nuget\packages\libsassbuilder\2.0.1\build\../tool/LibSassBuilder.dll" files "C:\Users\vladi\OneDrive\Documents\GitHub\blazor.radzen.com\Radzen.Blazor\themes\dark-base.scss" "C:\Users\vladi\OneDrive\Documents\GitHub\blazor.radzen.com\Radzen.Blazor\themes\dark.scss" "C:\Users\vladi\OneDrive\Documents\GitHub\blazor.radzen.com\Radzen.Blazor\themes\default-base.scss" "C:\Users\vladi\OneDrive\Documents\GitHub\blazor.radzen.com\Radzen.Blazor\themes\default.scss" "C:\Users\vladi\OneDrive\Documents\GitHub\blazor.radzen.com\Radzen.Blazor\themes\humanistic-base.scss" "C:\Users\vladi\OneDrive\Documents\GitHub\blazor.radzen.com\Radzen.Blazor\themes\humanistic.scss" "C:\Users\vladi\OneDrive\Documents\GitHub\blazor.radzen.com\Radzen.Blazor\themes\software-base.scss" "C:\Users\vladi\OneDrive\Documents\GitHub\blazor.radzen.com\Radzen.Blazor\themes\software.scss" "C:\Users\vladi\OneDrive\Documents\GitHub\blazor.radzen.com\Radzen.Blazor\themes\standard-base.scss" "C:\Users\vladi\OneDrive\Documents\GitHub\blazor.radzen.com\Radzen.Blazor\themes\standard.scss" --outputstyle expanded --level default " exited with code -532462766.

After several project clean/rebuild commands the error goes away till the next change in some of the scss files. The csproj and the scss files are located here, your input will be greatly appreciated!

CSS generation issues

I found this project after searching for a more up-to-date Sass implementation from Delegate.SassBuilder.

I'm using CSS isolation in Blazor, per:
https://docs.microsoft.com/en-us/aspnet/core/blazor/components/css-isolation?view=aspnetcore-5.0#css-preprocessor-support

Is there a way to ensure that the Blazor build waits on the Sass compilation to complete first?
It seems that the Blazor build continues without waiting for the CSS files to be generated first (and thus missing any changes in that build).

Additionally, CSS isn't re-generated (possibly due to the hash check) when CSS files are manually deleted.

no compile when sass included file has changed

Hello,

I have a main styles.sass that includes other _xx.sass.
In the config I have set

    <SassFile Include="wwwroot/css/**/*.sass" Exclude="wwwroot/css/**/_*.sass" />

to exclude included sass (which I think is also filtered in your code)
If any _xx.sass change but not the styles.sass, I got
1>LibSass_DetermineBuildNeeded:
Evaluating Sass files
Sass hash New = 97c3fbaf0eec1cff794ebc9a9fbf65565b7b0dd0
Sass hash Old = 97c3fbaf0eec1cff794ebc9a9fbf65565b7b0dd0
Sass changed = false

What should I do ?

Tx.

Regards,

Michael

project doesn't read the compiled CSS file

The compiled CSS file is not regester in the project!
After it compile the CSS file and runs application I have to close it and open the CSS file and save it (ctrl+s)
then the project recognize the CSS file
Note: if I modify the CSS file on the first run or even save it ( the project still not recognize it) i have to stop the app save the CSS file and run the app again to make it work. That's why I think it's not registered in the project.

macOS support

Great lib!

... and of course, the quest for also supporting, macOS is already here ;-)
Thanks.

How to use with Hot Reload?

Hello, and thanks for this wonderful tool.

Currently, I'm working with a lot of SCSS files, and after each edit I ALT+TAB out to my Terminal and enter lsb. Then lsb transforms all my *.scss files into *.css. dotnet will pick up these file changes, and then the gui is refreshed with new and fancy styles.

Is it possible to watch for changes in *.scss files and run lsb upon save (a change in scss-file)? It's getting tedious to run lsb upon each edit...

I'm using 6.0.0-rc.1.21452.15.

LibSassBuilder stops building in Visual Studio when the project's considered to be 'up-to-date'.

I find that LibSassBuilder sometimes intermittently randomly stops building in Visual Studio. I can't figure out the exact trigger for this - sometimes it seems to work fine, but frequently it just stops working. So there are a million different ways to reproduce this, and I only hope that you can reproduce it in the same way that's causing me so many problems, but this particular set of steps seems to reproduce it consistently - I can only apologise for how convoluted this seems but this is the simplest CONSISTENT set of repro steps I've managed:

Visual Studio 2019, version 16.9.0.
LibSassBuilder 1.6.1.

  1. Create a new C# console application in Visual Studio - choose .NET 5.0 as the target framework.
  2. In Solution Explorer, right-click on the project, choose Add > New Item, and add a new SCSS style sheet, e.g. StyleSheet1.scss.
  3. Add the LibSassBuilder NuGet package to the project.
  4. Build the solution, and note that the CSS gets generated correctly.
  5. Modify the SCSS then build the solution again; note that the CSS gets generated correctly again. So far so good.
  6. Rght-click on the project in Solution Explorer and choose 'Edit Project File', then modify the project file in some way - e.g. add a blank line, then save the file.
  7. Modify the SCSS file again.
  8. Build the solution, and note that the CSS gets generated correctly.
  9. Without making any more changes, build the solution again.
  10. Modify the SCSS file again.
  11. Build the solution, and note that the CSS does NOT get generated.

What's interesting here is that the build log message has now changed to '1 up-to-date'. Since we're not changing any code - only SCSS files - perhaps this makes sense??? But what I can't understand is why it seemed to behave differently earlier in the process and we could just change SCSS files and still trigger a build.

Setting config file to move output

Is there a way to set the config so that when the css file is compiled it outputs it to a different location? It might be a non-best practice but I like to keep my scss in an assets directory outside the wwwroot directory and then copy the compiled css to wwwroot/css/ when it's been updated.

Bootstrap SCSS variable override not generating any CSS

I've tried to override some Sass variables of bootstrap 5 but there doesn't seem to be any css generated from it.
bootstrap is installed with libman so all the bootstrap scss, css and js files are in wwwroot/lib/bootstrap/.

Then in wwwroot/css/ I have a bootstrap.override.scss file in which I followed the steps here:
https://getbootstrap.com/docs/5.0/customize/sass/#importing
and set i.e. $body-bg: #21232D
Then I included bootstrap.override.css in the index.html file head.
But once I build the project the bootstrap.override.css is empty.

I'm quite new to Sass so probably I missed something, I just have no idea what...

Visual Studio 2022 RC build error

Im trying to build our project in VS 2022 RC on Windows 11 and I'm getting the following error:

C:\Users\Niek.nuget\packages\libsassbuilder\1.6.4\build\LibSassBuilder.targets(90,5): error MSB3073: The command "dotnet "C:\Users\Niek.nuget\packages\libsassbuilder\1.6.4\build../tool/LibSassBuilder.dll" files "xxxxx\Web\Client.UI.Wasm\wwwroot\xxxx.scss" --outputstyle compressed --level default " exited with code -2147450730.

Any idea how to resolve this?

Include all *.razor.scss files, exclude specific others (app.razor.scss and all sass\*.scss files)

Hi.

I would like to include all *.razor.scss (under Pages and Shared) files to result in a *.css file, and I want to exclude app.razor.scss and all .scss files in my sass folder.

image

My config is now as follows:

<ItemGroup> <SassFile Include="**\*.razor.scss" Exclude="App.razor.scss, sass\*.scss" /> </ItemGroup>

However, this also results in an app.razor.css and sass\*.css files. If I delete corresponding generated css files and run again, nothing gets generated until I update one of those excluded .scss files, and css files will be generated again which I do not want (explicitly stated to exclude).

Any idea how I have to setup my SassFile Include and Exclude filter in order to include all *.razor.scss files but exclude app.razor.scss and all .scss files in my sass folder?

I am looking forward to hearing from you soon. Thanks in advance and keep up the good work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.