Posts

Showing posts from March, 2022

Donate

Install And Integrate Tailwind CSS 3.0 In ASP.NET Core MVC 5.0 Web Application

Image
Hi Felas! In this post, I will now demonstrate on how to integrate Tailwind CSS into an empty ASP.NET Core 5.0 MVC Web Application and the steps used where taken from my previous post on How To Install Tailwind CSS 3.0 Using Tailwind CLI And Visual Studio Code In Your Web Project Project Setup 1. Create a new ASP.NET Core MVC project using Visual Studio 2019. 2. Once created, add two empty css files called input.css and output.css inside the css subfolder of wwwroot. 3. In your _Layout.cshtml page, comment out or remove the code that references both the bootstrap.min.css and site.css files. 4. Replace that with output.css. For now this is just an empty stylesheet file and after the CLI build is done, this file will be populated with Tailwind css codes. Installing Tailwind CSS using CLI command 1. Open Package Manager Console in Visual Studio 2019 (Tools -> NuGet Package Manager -> Package Manager Console). 2. Run create package.json command. This will eventually ad

How To Install Tailwind CSS 3.0 Using Tailwind CLI And Visual Studio Code In Your Web Project

Image
Hello and Good afternoon! In this post, I will demonstrate on how to install Tailwind CSS 3.0 which is the latest version as of this writing using Tailwind CLI and Visual Studio Code Terminal. The steps presented in this article are derived solely from the documentation which is then applied to an empty web project using Visual Studio Code IDE and it's built-in terminal. This framework was introduced to me by a ex-colleague of mine who's now focused on working with the latest front-end JavaScript and CSS frameworks. According to the documentation, Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the building blocks you need to build bespoke designs without any annoying opinionated styles you have to fight to override. In a nutshell, it is a utility-first CSS framework for rapidly building custom designs. Ok enough talk and let's get down to business. 1. Create a projects folder called test-project with three subdirectories namely cs

Remove Last Character Of A String From StringBuilder Added Using AppendLine() In C#

Image
Good afternoon! In a situtation where you add string values to a StringBuilder object using the AppendLine() method and you want to delete the last character, you might expect that using the Remove() method in the code below will work. But the truth is it does not. private static void RemoveLastCharacter() { StringBuilder sb = new StringBuilder(); sb.AppendLine( "Lorem ipsum dolor sit amet, consectetur adipiscing elit," ); sb.AppendLine( "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." ); sb = sb.Remove(sb.Length - 1, 1); Console.WriteLine(sb.ToString()); } Using Appendline() method to populate the StringBuilder object according to the documentation will also append the default line terminator after the string value to the end of the StringBuilder instance. Since the default line terminator has two characters specifically "\r\n", we need to include those two characters plus the last character of the string. The revise

Donate