johan-v-r / libsassbuilder Goto Github PK
View Code? Open in Web Editor NEWSass builder for .NET projects
License: MIT License
Sass builder for .NET projects
License: MIT License
Would it be possible to add support for Linux?
Thanks
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?
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>
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.
I am using the latest version of Maui on Windows 10.
This is what I am seeing:
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!
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:
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:
EndsWith
to take the whole directory name into account.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>
This issue is now once again an issue. All the .scss files are hidden in Rider after installing LibSassBuilder
Is it possible to run the nuget package manually in the console outside of dotnet build? For example rebuilding the sass files while debugging?
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.
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
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 !
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? :)
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?
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!
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';
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?
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!
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?
I develop in vscode using "dotnet watch run" and in the 1.6.4 version all compilation has stopped working. If I revert back to 1.6.3 it all starts working again.
Here is the csproj/project
https://github.com/StableCube/Bulzor/blob/master/Demo/Server/Demo.Server.csproj
Any ideas why this may be happening?
Thanks
Any plans to switch?
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.
<ItemGroup>
<SassFile Remove="StyleSheet1.scss" />
</ItemGroup>
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.
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?
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?
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.
Windows 10 21H1 (19043)
Visual Studio 2019 (v 16.11.5)
Blazor WASM NET5 (NETCORE 3.1)
LibSassBuilder Version 1.6.4
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.
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>
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
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.
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!
If the ( compiled CSS ) been deleted and the SCSS file is not edited or ( Ctrl+S ) saved without modifying it, the CSS file won't be populated again.
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.
It seams that LibSasHost renamed that outputstyle.
LibSassBuilder gives an error using condensed, but works with compact. So it is more of a documentation issue.
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
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.
Great lib!
... and of course, the quest for also supporting, macOS is already here ;-)
Thanks.
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.
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.
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.
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.
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...
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?
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.