<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Dirk Strauss</title>
    <description>The latest articles on Forem by Dirk Strauss (@dirkstrauss).</description>
    <link>https://forem.com/dirkstrauss</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F121271%2F80c4b190-adf1-44b3-91b6-46fb8834eb24.jpg</url>
      <title>Forem: Dirk Strauss</title>
      <link>https://forem.com/dirkstrauss</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dirkstrauss"/>
    <language>en</language>
    <item>
      <title>Installing Visual Studio Code on Linux</title>
      <dc:creator>Dirk Strauss</dc:creator>
      <pubDate>Thu, 22 Apr 2021 19:03:04 +0000</pubDate>
      <link>https://forem.com/dirkstrauss/installing-visual-studio-code-on-linux-gb8</link>
      <guid>https://forem.com/dirkstrauss/installing-visual-studio-code-on-linux-gb8</guid>
      <description>&lt;p&gt;Installing Visual Studio Code on Linux is quick and really easy. If you are a Linux user, then this article might be old news to you. If, however, you are a developer that usually works on Windows but likes to play around a bit with Linux, then stick around. Perhaps this article can give you some pointers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking for something else? Try these links instead:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/visual-studio-2022-releasing-this-summer-5fef-temp-slug-6876487"&gt;Visual Studio 2022 Releasing this Summer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/visual-studio-intellicode-ai-for-your-code-68a"&gt;Visual Studio IntelliCode – AI For your Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/enabling-c-8-in-visual-studio-2019-2ppg-temp-slug-4920757"&gt;Enabling C# 8 in Visual Studio 2019&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/c-8-0-what-c-version-does-my-app-use-5eh9-temp-slug-8516759"&gt;What C# version does my App use?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/moving-virtualbox-vm/"&gt;Moving VirtualBox VM’s To An External Drive&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you know by now, Visual Studio Code is free and built on open source. Git is integrated and Visual Studio Code allows you to install extensions if you need something specific to your workflow. To install Visual Studio Code on Linux, I will be using Snap. If you for some reason do not have snap packages listed in your software centre, you can enable Snap support in your Linux distribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enabling Snap support in Linux
&lt;/h2&gt;

&lt;p&gt;I am running Linux Mint in a VM to illustrate how to use Snap. Linux Mint is a Linux distribution based on Ubuntu. If you haven’t enabled Snap support for your Linux distribution, you can do so by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install snapd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will install Snap for my version of Linux. Therefore, if you are using a distribution based on Ubuntu, you can use the command above to get Snap.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Snap?
&lt;/h2&gt;

&lt;p&gt;The quick explanation is that Snap is a universal Linux package that will work on any Linux distribution. Snaps are therefore applications compiled including all the required dependencies and libraries. This will create a sandboxed environment for your application to run in.&lt;/p&gt;

&lt;p&gt;This means that you no longer have to worry about finding and installing the correct package (DEB, RPM etc.) for your Linux distribution. Updates are also automatic and goes out to everyone, no matter what the base OS is. Because Snaps run sandboxed, it is more secure because it is isolated from the rest of your system. Check out the website for &lt;a href="https://snapcraft.io/about"&gt;more info regarding Snap&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Snap on other Distributions
&lt;/h2&gt;

&lt;p&gt;To enable support for Snap on Fedora based distributions, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo dnf install snapd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enabling support for Snap on Arch based distributions, run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yaourt -S snapd
sudo systemctl enable --now snapd.socket
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have Snap installed, you need to find Visual Studio Code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Visual Studio Code on Linux using Snap
&lt;/h2&gt;

&lt;p&gt;As mentioned earlier, Visual Studio Code is available as a Snap package. I will be using commands throughout to install Visual Studio Code. To find Visual Studio Code, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap find vscode
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the following output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--x9d3ES4G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/snapd-find-visual-studio-code.jpg%3Fresize%3D640%252C159%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--x9d3ES4G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/snapd-find-visual-studio-code.jpg%3Fresize%3D640%252C159%26ssl%3D1" alt="Finding Visual Studio Code on Snap"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The name of the snap package is &lt;code&gt;code&lt;/code&gt; which means that you can use the following command to install Visual Studio Code on Linux.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap install code --classic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Depending on your Internet connection speed, this might take a few minutes to download. Once it is done, you can fire up Visual Studio Code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FNKw7opT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/visual-studio-code-running-on-linux.jpg%3Fresize%3D640%252C421%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FNKw7opT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/visual-studio-code-running-on-linux.jpg%3Fresize%3D640%252C421%26ssl%3D1" alt="Visual Studio Code Installed on Linux Mint"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is Visual Studio Code running on my version of Linux Mint. You are of course not required to use Snap to install Visual Studio Code on Linux. You could always just download the .deb and .rpm files for your flavour of Linux.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Visual Studio Code on Linux via Software Package
&lt;/h2&gt;

&lt;p&gt;You can head over to the &lt;a href="https://code.visualstudio.com/download"&gt;Visual Studio Code Downloads page&lt;/a&gt; and find the correct package for your Linux distribution. Linux distributions based on Ubuntu, such as Linux Mint that I am using requires me to download and install the .deb file. If you are using Fedora and SUSE based Linux distros, grab the .rpm file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O_DwNaMV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/visual-studio-code-downloads-page.jpg%3Fresize%3D640%252C749%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O_DwNaMV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/visual-studio-code-downloads-page.jpg%3Fresize%3D640%252C749%26ssl%3D1" alt="Installing Visual Studio Code on Linux via downloads page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is really very nice to see that Visual Studio Code is available for Apple Silicon too. As a software developer using Linux, you have everything you need to install Visual Studio Code on Linux.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Snap on Linux
&lt;/h2&gt;

&lt;p&gt;There are various commands that you can run with Snap. In essence, Snap is similar to &lt;code&gt;apt-get&lt;/code&gt; commands. Here is a list of some of the commands that you could find useful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Finding Snap Packages
&lt;/h3&gt;

&lt;p&gt;As we saw earlier, you can find packages on Snap by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;snap find &amp;lt;text_to_find&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The search query entered in the place of &lt;code&gt;&amp;lt;text_to_find&amp;gt;&lt;/code&gt; does not need to be an exact match. The command will find similar results to the search query you entered.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Snap Packages
&lt;/h3&gt;

&lt;p&gt;As before, the command to install Snap packages is also quite easy. Once you have found the name of the package to install via the find command, you can install the package as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap install &amp;lt;package_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;&amp;lt;package_name&amp;gt;&lt;/code&gt; is obviously the name of the package in the find results.&lt;/p&gt;

&lt;h3&gt;
  
  
  Listing Installed Snap Packages
&lt;/h3&gt;

&lt;p&gt;If you want to see the installed Snap packages on your system, you can simply run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;snap list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command return a list of packages installed as seen in the following screenshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_z87eXgV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/listing-snap-packages.jpg%3Fresize%3D583%252C229%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_z87eXgV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/listing-snap-packages.jpg%3Fresize%3D583%252C229%26ssl%3D1" alt="Listing Snap packages on your Linux system"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, the list includes the package name, version, revision, tracking, published, and notes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Listing Changes to Installed Snap Packages
&lt;/h3&gt;

&lt;p&gt;To see any changes to Snap installed Snap packages, you can run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;snap changes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will list apps that have recently been updated, as seen in the screenshot below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qUqsKnlN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/listing-snap-changes.jpg%3Fresize%3D640%252C160%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qUqsKnlN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/listing-snap-changes.jpg%3Fresize%3D640%252C160%26ssl%3D1" alt="List Changes to Installed Snap Packages"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see that the .NET Core was refreshed automatically before Visual Studio Code was installed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Refreshing, Updating, and Reverting Installed Snap Packages
&lt;/h3&gt;

&lt;p&gt;Earlier I mentioned that Snap packages are automatically updated if there is an update available. It isn’t necessary to manually go updating Snap packages. If you wanted to you can check to see which Snap packages have updates waiting to be installed by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap refresh --list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will list packages with updates ready to be installed. To manually update an installed package, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap refresh &amp;lt;package_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to revert a Snap package, the following command will do the trick:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap revert &amp;lt;package_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will revert the currently installed version to the previous version.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deleting Snap Packages
&lt;/h3&gt;

&lt;p&gt;To remove an installed Snap package, you can do the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap remove &amp;lt;package_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This essentially uninstalls the package from your Linux system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Visual Studio Code on Linux using Channels
&lt;/h2&gt;

&lt;p&gt;The channels feature of Snap allows users to switch between stable and development releases of a package. By default, Snap packages are installed form the stable channel (which makes sense). If you are more bleeding edge, you can switch between these channels as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap refresh &amp;lt;package_name&amp;gt; --channel=&amp;lt;channel_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The available channels are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stable – this is the default channel&lt;/li&gt;
&lt;li&gt;candidate – this is a release candidate nearing a stable release&lt;/li&gt;
&lt;li&gt;beta – this is an unstable version of the application&lt;/li&gt;
&lt;li&gt;edge – the daily or nightly build of an app still in development&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All future updates to the application will come from the channel it was installed from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Downloading Snap Packages
&lt;/h2&gt;

&lt;p&gt;If for some reason, you need to install Snap packages offline, you can download them as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;snap download &amp;lt;package_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will download the .assert and .snap file that you can stick onto a thumb drive and copy to a different Linux machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qupQzxdZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/downloading-snap-packages.jpg%3Fresize%3D486%252C178%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qupQzxdZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/downloading-snap-packages.jpg%3Fresize%3D486%252C178%26ssl%3D1" alt="Downloading Snap Applications"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see from the screenshot above, you need to install the downloaded package as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;snap ack &amp;lt;package_name.assert&amp;gt;
snap install &amp;lt;package_name.snap&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All these terminal commands remind me of running &lt;code&gt;dotnet&lt;/code&gt; commands, and this is the point of this article. If you’re developing applications in .NET Core (or .NET 5.0 and later), working from a terminal window will feel very natural.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Installed Visual Studio Code on Linux
&lt;/h2&gt;

&lt;p&gt;Last but not least, running your Snap is just as easy if you know the run command. This is usually just the name of the Snap. In our case, simply the word &lt;code&gt;code&lt;/code&gt; will start Visual Studio Code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Af_rlfuv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/running-visual-studio-code-snap.jpg%3Fresize%3D486%252C178%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Af_rlfuv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/running-visual-studio-code-snap.jpg%3Fresize%3D486%252C178%26ssl%3D1" alt="Running the Installed Snap"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that’s all there is to it. Wasn’t that super easy?&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Visual Studio Code on Linux is Super Easy with Snap
&lt;/h2&gt;

&lt;p&gt;If there is anything I have left out, please let me know in the comments section. I have only recently started playing around with Snap on Linux and I have to admit, it does make life easier. Being a noob, however, does leave the door open for mistakes. Learning is fun and I hope that using Snap and Visual Studio Code makes your dev workflow more productive.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://dirkstrauss.com/installing-visual-studio-code-on-linux/"&gt;Installing Visual Studio Code on Linux&lt;/a&gt; appeared first on &lt;a href="https://dirkstrauss.com"&gt;Programming and Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>technology</category>
      <category>installvisualstudioc</category>
      <category>linux</category>
    </item>
    <item>
      <title>Visual Studio 2022 Releasing this Summer</title>
      <dc:creator>Dirk Strauss</dc:creator>
      <pubDate>Wed, 21 Apr 2021 15:40:53 +0000</pubDate>
      <link>https://forem.com/dirkstrauss/visual-studio-2022-releasing-this-summer-ef4</link>
      <guid>https://forem.com/dirkstrauss/visual-studio-2022-releasing-this-summer-ef4</guid>
      <description>&lt;p&gt;It’s official, the first public preview of Visual Studio 2022 will be released this Summer. What is even more exciting news, is that this version of Visual Studio will be 64-bit. This means that developers will no longer be limited to ~4gb of RAM in the devenv.exe process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking for Something Else? Try These Links Instead:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/enabling-c-8-in-visual-studio-2019-2ppg-temp-slug-4920757"&gt;Enabling C# 8 in Visual Studio 2019&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/visual-studio-intellicode-ai-for-your-code-68a"&gt;Visual Studio IntelliCode – AI For your Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/mastering-visual-studio-2017/"&gt;Mastering Visual Studio 2017&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/using-code-shortcuts-visual-studio-2017/"&gt;Using Code Shortcuts in Visual Studio 2017&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is worth noting that Visual Studio 2022 will not change the types or bitness of apps that you can create. You will still be able to create 32-bit applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  No More Out of memory Exceptions in Visual Studio 2022
&lt;/h2&gt;

&lt;p&gt;In the &lt;a href="https://devblogs.microsoft.com/visualstudio/visual-studio-2022/"&gt;original dev blog post&lt;/a&gt;, Amanda Silver (CVP of Product, Developer Division) highlighted the fact that Visual Studio 2022 will scale up to use the additional memory that’s available to a 64-bit process. The embedded video demoed a solution containing 1,600 projects and ~300k files loading in under 3 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  User Interface Refresh
&lt;/h2&gt;

&lt;p&gt;I know that some might cringe when they hear UI refresh. I know I did (remember the Visual Studio 2015 CAPS menu bar?). These changes, however, seem to be subtle and cosmetic. They are aimed at modernizing the UI and to reduce crowding.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SFJ7DIYZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/visual-studio-2022-icon-refresh.png%3Fresize%3D640%252C152%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SFJ7DIYZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2021/04/visual-studio-2022-icon-refresh.png%3Fresize%3D640%252C152%26ssl%3D1" alt="Visual Studio 2022 refreshed icons"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Overall, we aim to reduce complexity and decrease the cognitive load so that you can focus and stay in the zone ~ Amanda Silver&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Visual Studio 2022 will include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Updated icons that are clearer, more legible, and improve contrast.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/microsoft/cascadia-code#welcome"&gt;Cascadia Code&lt;/a&gt;, a new fixed-width font for better readability and ligature support.&lt;/li&gt;
&lt;li&gt;Refreshed and improved product themes.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://accessibilityinsights.io/"&gt;Accessibility Insights&lt;/a&gt; integration that detects accessibility issues earlier.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Personalization has also been made easier to allow you to get that “just right” feel for your workflow. Allowing you to customize aspects of the IDE and sync those settings across devices. This is good for developers working on multiple machines.&lt;/p&gt;

&lt;h2&gt;
  
  
  Visual Studio 2022 will Support .NET 6 and MAUI
&lt;/h2&gt;

&lt;p&gt;Full support will be included for .NET 6 and the unified framework. This is something that I am extremely excited about. You might have heard about .NET Multi-platform App UI or &lt;a href="https://github.com/dotnet/maui"&gt;.NET MAUI&lt;/a&gt;. This will allow cross-platform client applications on Windows, Android, macOS, and iOS.&lt;/p&gt;

&lt;p&gt;The past couple of months, I have been playing around with Xcode and SwiftUI as well as Xamarin. While this was a lot of fun, and something I will continue doing, I must admit that MAUI is a leap forward in .NET development. What’s more, for most apps such as web, desktop, and mobile, .NET Hot Reload will allow you to apply code changes without having to restart.&lt;/p&gt;

&lt;h2&gt;
  
  
  Innovative Features
&lt;/h2&gt;

&lt;p&gt;Debugging is a big part of your development workflow. Improvements in performance in the core debugger will make debugging less of a resource kill for those with lighter specked machines. Flame charts in the profiler will surface hot paths. Dependant breakpoints will allow you to be more precise when debugging, and integrated decompilation experiences will allow you to step through code not stored locally.&lt;/p&gt;

&lt;p&gt;Lately I have been doing more pair programming and code reviews with a colleague of mine. Live Share will now include integrated text chat. You will also be able to schedule recurring sessions by reusing the same link. If your organization has specific policies in place with regards to Live Share, you can introduce session policies. These will define compliance requirements for collaboration, for example, should read/write terminals be shareable?&lt;/p&gt;

&lt;p&gt;The AI IntelliCode engine also gets smarter. It will now anticipate what you want to type next and offer that as a code completion suggestion. So now typing &lt;code&gt;Cons&lt;/code&gt; will suggest a completion for &lt;code&gt;Console.WriteLine&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working with Code gets Better
&lt;/h2&gt;

&lt;p&gt;Visual Studio 2022 will now include new support for Git and GitHub with built-in logic and checkpoints to help you along the merge and review process. Improved code search features will also allow you to search outside your loaded scope. This means finding exactly what you need, irrespective of what code base or repo that code is located in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Visual Studio for Mac
&lt;/h2&gt;

&lt;p&gt;There is also some love coming to Visual Studio for Mac with Microsoft working to move this over to the native macOS UI. This will increase the performance and reliability. I do wonder if this will be supported on the new M1 Macs. An update of menus and terminology across the IDE will make Visual Studio consistent between Windows and Mac. This includes the new Git experience from Visual Studio that will be coming to Visual Studio for Mac.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Some of these features will be available after the first public release. The changes coming to Visual Studio 2022 are exciting to say the least. Keep an eye out for announcements about Preview 1 in the coming weeks and have a browse through the &lt;a href="https://developercommunity.visualstudio.com/search?space=8&amp;amp;ftype=idea"&gt;Developer Community feature requests&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://dirkstrauss.com/visual-studio-2022/"&gt;Visual Studio 2022 Releasing this Summer&lt;/a&gt; appeared first on &lt;a href="https://dirkstrauss.com"&gt;Programming and Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>technology</category>
      <category>visualstudio2022</category>
      <category>net6</category>
      <category>netmaui</category>
    </item>
    <item>
      <title>Visual Studio IntelliCode – AI For your Code</title>
      <dc:creator>Dirk Strauss</dc:creator>
      <pubDate>Mon, 03 Jun 2019 21:21:13 +0000</pubDate>
      <link>https://forem.com/dirkstrauss/visual-studio-intellicode-ai-for-your-code-68a</link>
      <guid>https://forem.com/dirkstrauss/visual-studio-intellicode-ai-for-your-code-68a</guid>
      <description>&lt;p&gt;Visual Studio IntelliCode allows you to add the power of artificial intelligence to your code. Enabling IntelliCode is super easy, and I’m going to show you exactly how to do this.&lt;/p&gt;

&lt;h2&gt;
  
  
  LOOKING FOR SOMETHING ELSE? TRY THESE LINKS INSTEAD:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/extension-methods-are-easy-with-c-235d"&gt;Extension Methods Are Easy with C#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/struggling-with-imposter-syndrome-think-overcome/"&gt;Struggling With Imposter Syndrome? How To Think And Overcome&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/flexible-working-hours/"&gt;Flexible Working Hours – You Can Work From Home!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/improve-code-skills-consider-blogging/"&gt;Improve Code Skills? Consider Blogging&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/automate-trello-using-devops-wunderlist/"&gt;Automate Trello using DevOps and Wunderlist&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are a bit short on time, go and check out the video explainer on this topic.&lt;/p&gt;

&lt;p&gt;This should get you up to speed quickly enough. If you enjoy the video, please consider subscribing to the channel and giving the video a thumbs up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Visual Studio IntelliCode Explained
&lt;/h2&gt;

&lt;p&gt;IntelliCode is a super exciting addition to Visual Studio. &lt;a href="https://visualstudio.microsoft.com/services/intellicode/"&gt;Microsoft calls it AI-assisted development&lt;/a&gt;. It will save you time by putting what you are most likely to use at the top of your completion list. These are displayed as starred recommendations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IxQhzVJQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2019/06/intellicode.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IxQhzVJQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2019/06/intellicode.png%3Fw%3D640%26ssl%3D1" alt="Suggestions based on code context"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;IntelliCode uses open source GitHub projects with 100 stars or more to generate recommendations for your code. IntelliCode will also build a custom model to provide recommendations from your source code. These are things such as methods from your own classes or domain specific library calls.&lt;/p&gt;

&lt;p&gt;Note: IntelliCode features are off by default. To enable these, go to &lt;strong&gt;Tools&lt;/strong&gt; &amp;gt; &lt;strong&gt;Options&lt;/strong&gt; &amp;gt; &lt;strong&gt;IntelliCode&lt;/strong&gt; and enable the features.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kQi5cBzU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2019/06/intellicode-options.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kQi5cBzU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2019/06/intellicode-options.png%3Fw%3D640%26ssl%3D1" alt="Visual Studio IntelliCode features are off by default"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will enable IntelliCode for your project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Visual Studio IntelliCode
&lt;/h2&gt;

&lt;p&gt;If you don’t have IntelliCode installed, head on over to the &lt;strong&gt;Extensions&lt;/strong&gt; &amp;gt; &lt;strong&gt;Manage Extensions&lt;/strong&gt; window to download and install it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---sfWW5GE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2019/06/intellicode-installation.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---sfWW5GE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2019/06/intellicode-installation.png%3Fw%3D640%26ssl%3D1" alt="Installing from Manage Extensions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After downloading, you will need to restart Visual Studio in order to install IntelliCode.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building an IntelliCode Model
&lt;/h2&gt;

&lt;p&gt;In Visual Studio 2019, hit &lt;strong&gt;Ctrl+Q&lt;/strong&gt; and type &lt;strong&gt;IntelliCode&lt;/strong&gt; into the search window. Select &lt;strong&gt;IntelliCode Model Management&lt;/strong&gt; from the results or go to &lt;strong&gt;View&lt;/strong&gt; &amp;gt; &lt;strong&gt;Other Windows&lt;/strong&gt; &amp;gt; &lt;strong&gt;IntelliCode Model Management&lt;/strong&gt; to access the Visual Studio IntelliCode window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IllwTK1L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2019/06/visual-studio-intellicode.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IllwTK1L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2019/06/visual-studio-intellicode.png%3Fw%3D640%26ssl%3D1" alt="Visual Studio IntelliCode Model Management"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From here, you can build IntelliCode models for your projects. You can see the models shared with you, share the model you just built, retrain or delete the IntelliCode model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can I Use it in My Code?
&lt;/h2&gt;

&lt;p&gt;At the time of this post, IntelliCode works in Visual Studio 2017 (version 15.8 and up) as wella s Visual Studio 2019. It also supports the following languages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C#&lt;/li&gt;
&lt;li&gt;C++&lt;/li&gt;
&lt;li&gt;XAML (In Visual Studio 2019)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;IntelliCode also works in Visual Studio Code and supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Microsoft is bringing the goodness of AI to Visual Studio Code. Now that is really neat!&lt;/p&gt;

&lt;h2&gt;
  
  
  View Extracted Data
&lt;/h2&gt;

&lt;p&gt;After you have generated your model, you can head over to the following folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; %TEMP%\Visual Studio IntelliCode 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here you should see a &lt;strong&gt;UsageOutput&lt;/strong&gt; folder in one of the created folders. Look for a usage JSON file. This is the contents of the extracted data. Code analysis all happens client side. This data extraction is then fed into Microsoft’s Model Service which is uploaded to the service in the cloud.&lt;/p&gt;

&lt;p&gt;It is important to note that Microsoft doesn’t receive any of your code. It only uploads data and information about your code. So your code remains on your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get the Source Code
&lt;/h2&gt;

&lt;p&gt;If you want to grab a working example of the code used in this blog post, head on over to the following GitHub repo and clone the repo to your local machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/dirkstrauss/IntelliCodeDemo"&gt;dirkstrauss/IntelliCodeDemo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any comments or suggestions, please feel free to put those in the comments section below. Give it a try, and see what IntelliCode can do for you!&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://dirkstrauss.com/visual-studio-intellicode/"&gt;Visual Studio IntelliCode – AI For your Code&lt;/a&gt; appeared first on &lt;a href="https://dirkstrauss.com"&gt;Programming and Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>programming</category>
    </item>
    <item>
      <title>Extension Methods Are Easy with C#</title>
      <dc:creator>Dirk Strauss</dc:creator>
      <pubDate>Tue, 28 May 2019 19:25:37 +0000</pubDate>
      <link>https://forem.com/dirkstrauss/extension-methods-are-easy-with-c-235d</link>
      <guid>https://forem.com/dirkstrauss/extension-methods-are-easy-with-c-235d</guid>
      <description>&lt;p&gt;I have said this many times before, I love using extension methods. They are probably the easiest methods to write and can power up your code like never before. If you what to find out more, read on.&lt;/p&gt;

&lt;h2&gt;
  
  
  LOOKING FOR SOMETHING ELSE? TRY THESE LINKS INSTEAD:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dirkstrauss.com/c-7-net-core-cookbook-published/"&gt;C# 7 and .NET Core Cookbook Published&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dirkstrauss.com/the-unbelievably-powerful-multi-select/"&gt;The Unbelievably Powerful Multi Select. Increase Productivity Now&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/cool-life-hacks-using-simple-technology/"&gt;Cool Life Hacks using Simple Technology Hacks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/sassy-css--the-valuable-benefits-you-need-to-know-5447-temp-slug-6301632"&gt;Sassy Css – The Valuable Benefits You Need To Know&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/struggling-with-imposter-syndrome-think-overcome/"&gt;Struggling With Imposter Syndrome? How To Think And Overcome&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are a bit short on time, go and check out the video explainer on this topic.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/BKJGnmWcCVw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This should get you up and running quickly with using extension methods in your own applications to enhance your code. If you want a little more, keep on reading.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extension Methods Explained
&lt;/h2&gt;

&lt;p&gt;If you want to add methods to existing types without having to recompile your code or without creating a new derived type, then extension methods are the way to go.&lt;/p&gt;

&lt;p&gt;Extension methods are a special type of static method. These are then called on the type you are extending as if they were instance methods.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--acntPoOR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2019/05/IntelliSence.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--acntPoOR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2019/05/IntelliSence.png%3Fw%3D640%26ssl%3D1" alt="Extension Method displayed in IntelliSence"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have a look at the &lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods"&gt;Microsoft document explaining extension methods&lt;/a&gt; in depth. Consider the following code listing:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static bool ToInt(this string value)
{
    return int.TryParse(value, out var _);
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This is a typical extension method that acts on a string type and checks to see if the string can be parsed to a valid Integer. Note that the TryParse uses an out var using a discards variable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TIP:&lt;/strong&gt; Introduced in C# 7.0, discards are temporary, dummy variables are intentionally unused. A discard is indicated by using the underscore (_) for its variable name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Extension Methods
&lt;/h2&gt;

&lt;p&gt;In order to use your extension method, you need to just call it as you would any method of that type. In our case, we are extending the String type. This is seen by the extension method signature in the previous code listing. It enables us to do the following:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var sValue = "15";
if (sValue.ToInt())
{
    // Do something
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If the String variable can successfully be parsed to an Integer, then the extension method will return True. You can even modify the method to return the integer it parsed, instead of a Boolean. You would, of course, need to gracefully handle cases where the String value could not be parsed to an Integer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get the Source Code
&lt;/h2&gt;

&lt;p&gt;If you want to grab a working example of the code, head on over to the following GitHub repo and clone the repo to your local machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/dirkstrauss/ExtensionMethodsDemo"&gt;dirkstrauss/ExtensionMethodsDemo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any comments or suggestions, please feel free to put those in the comments section below.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://dirkstrauss.com/extension-methods-are-easy/"&gt;Extension Methods Are Easy with C#&lt;/a&gt; appeared first on &lt;a href="https://dirkstrauss.com"&gt;Programming and Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>codetips</category>
      <category>extendingmethods</category>
    </item>
    <item>
      <title>Responsive Tables – How to scale your site beautifully</title>
      <dc:creator>Dirk Strauss</dc:creator>
      <pubDate>Wed, 19 Dec 2018 07:12:15 +0000</pubDate>
      <link>https://forem.com/dirkstrauss/responsive-tables--how-to-scale-your-site-beautifully-4d8m</link>
      <guid>https://forem.com/dirkstrauss/responsive-tables--how-to-scale-your-site-beautifully-4d8m</guid>
      <description>&lt;p&gt;Responsive Tables provide flexibility to your site to scale well, especially when it comes to viewing tables on mobile devices. But for some websites, responsive tables are non-existent. You might wonder how an existing table on a website can be made responsive. Please note, by responsive, I do not mean horizontal scroll bars.&lt;/p&gt;

&lt;h3&gt;
  
  
  Looking for something else? Try these links instead:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/chrome-developer-tools--easy-web-debugging-you-need-to-know-30na"&gt;Chrome Developer Tools – Easy Web Debugging You Need to Know&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/chrome-dev-tools--more-advanced-tips-for-better-debugging-5cgh"&gt;Chrome Dev Tools – More Advanced Tips for Better Debugging&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/sassy-css--the-valuable-benefits-you-need-to-know-5447-temp-slug-6301632"&gt;Sassy Css – The Valuable Benefits You Need To Know&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/sass-css--this-awesome-extension-will-make-you-sassy-35m0"&gt;Sass CSS – This Awesome Extension Will Make You Sassy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/the-unbelievably-powerful-multi-select/" rel="noopener noreferrer"&gt;The Unbelievably Powerful Multi Select. Increase Productivity Now&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was looking for some information regarding responsive tables and came across &lt;a href="https://allthingssmitty.com/2016/10/03/responsive-table-layout/" rel="noopener noreferrer"&gt;Matt Smith’s article on Responsive table layouts&lt;/a&gt;. Let us have a look at a standard table that displays planet data.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please note that all the sourcecode in this Visual Studio project is &lt;a href="https://github.com/dirkstrauss/ResponsiveTables" rel="noopener noreferrer"&gt;available on Github&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  HTML Table
&lt;/h2&gt;

&lt;p&gt;For this example, I will use some straightforward markup to &lt;a href="https://codepen.io/dirkstrauss/pen/GPqbOz" rel="noopener noreferrer"&gt;create a table to hold planet data&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In Visual Studio I added some additional styling using Scss and when I run my web project, my table looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-plain-table.jpg%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-plain-table.jpg%3Fw%3D640%26ssl%3D1" alt="Responsive Tables - Plain table"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not too bad hey? Well let’s have a look at how our table looks when viewed on an iPhone X.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-mobile-view.jpg%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-mobile-view.jpg%3Fw%3D640%26ssl%3D1" alt="Responsive Tables Mobile View"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This definitely does not look too good to me. It’s not horrible, but does not pass the grade in my opinion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making the planet table more responsive
&lt;/h2&gt;

&lt;p&gt;To do this, I added a &lt;strong&gt;data-label&lt;/strong&gt; attribute to each table data element. The &lt;strong&gt;data-label&lt;/strong&gt; value is the value of each column’s name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;td data-label="Planet"&amp;gt;Mercury&amp;lt;/td&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I added the CSS media query Matt suggested in his article. &lt;a href="https://codepen.io/dirkstrauss/pen/LMZwxa" rel="noopener noreferrer"&gt;Here is the full pen including the CSS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Have a look at this table now. It definitely looks much better than the previous layouts above.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-css.jpg%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-css.jpg%3Fw%3D640%26ssl%3D1" alt="Responsive Tables CSS Media Query"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is really great and meets our end goal of having a table respond to a mobile device in a manner that is user-friendly and more readable to the user. There are definitely other solutions to making responsive tables, as outlined in this &lt;a href="https://www.sitepoint.com/responsive-data-tables-comprehensive-list-solutions/" rel="noopener noreferrer"&gt;comprehensive list of solutions by sitepoint&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I did want to work with the Bootstrap grid system. I’m sure that doing this will result in an easier code base to work with.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bootstrap Responsive Tables Example
&lt;/h2&gt;

&lt;p&gt;I wanted to do this using only &lt;strong&gt;div&lt;/strong&gt; tags. As you probably know, if you want responsive then a good choice is to use Bootstrap. &lt;a href="https://codepen.io/dirkstrauss/pen/YdWmow" rel="noopener noreferrer"&gt;Here is the CodePen&lt;/a&gt; for the code. Note: Just a reminder, all the source code is &lt;a href="https://github.com/dirkstrauss/ResponsiveTables" rel="noopener noreferrer"&gt;available on GitHub&lt;/a&gt; too.&lt;/p&gt;

&lt;p&gt;Looking at this code, you will see that I have used Scss as my CSS Preprocessor. When I view the mobile version of the site, you will see that the result is quite the same as before. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-bootstrap-example.jpg%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-bootstrap-example.jpg%3Fw%3D640%26ssl%3D1" alt="Responsive Tables Bootstrap Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bootstrap and the media query has responded well to keep the table of data readable and responsive.&lt;/p&gt;

&lt;p&gt;I wanted to take this one step further. If you need to create a table that is responsive and that includes filtering and a host of other functionality, have a look at &lt;a href="https://isotope.metafizzy.co/" rel="noopener noreferrer"&gt;Isotope&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple Responsive Tables Example using Isotope
&lt;/h2&gt;

&lt;p&gt;Getting up to speed using Isotope is really easy. Let’s have a look at our table first. You will notice that I have added some more celestial bodies (dwarf planets) to the grid. &lt;/p&gt;

&lt;p&gt;Each Category planet (if that is the correct terminology), is colored differently for clarity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-isotope.jpg%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-isotope.jpg%3Fw%3D640%26ssl%3D1" alt="Responsive Tables Isotope"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To add Isotope to your Web Application, you need to &lt;a href="https://isotope.metafizzy.co/" rel="noopener noreferrer"&gt;visit the Isotope page&lt;/a&gt; and download the &lt;strong&gt;isotope.pkgd.min.js&lt;/strong&gt; file and add this to your site. You can also link directly to the CDN if you like.&lt;/p&gt;

&lt;p&gt;In the screenshot below you will notice the Isotope file added to my &lt;strong&gt;Scripts&lt;/strong&gt; folder. You will also notice the &lt;strong&gt;custom.js&lt;/strong&gt; file I added. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-add-isotope-to-project.jpg%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-add-isotope-to-project.jpg%3Fw%3D640%26ssl%3D1" alt="Responsive Tables Add Isotope To Project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create the custom.js file
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;custom.js&lt;/strong&gt; file will contain the custom script for the Isotope grid.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var $grid;
var isoOptions;

$(function () {
    // Set the Isotope Grid Options
    isoOptions = {
        // options
        itemSelector: '.grid-item',
        masonry: {
            columnWidth: '.col-md-4'
        }
    };

    // Initialize the Isotope Grid
    $grid = $('.grid-container').isotope(isoOptions);

    // The Filter Button Click. This will filter the Isotope Grid by the class selected
    $('.button-filter').on('click', 'button', function () {
        var filterValue = $(this).attr('data-filter');
        currentFilter = filterValue; // Keep a variable set for the currently selected filter
        $grid.isotope({ filter: filterValue });
    });
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we need to modify the &lt;strong&gt;BundleConfig&lt;/strong&gt; file and add the following to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bundles.Add(new ScriptBundle("~/bundles/isotope").Include("~/Scripts/isotope.pkgd.min.js"));
bundles.Add(new ScriptBundle("~/bundles/custom").Include("~/Scripts/custom.js"));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the &lt;strong&gt;_Layout.cshtml&lt;/strong&gt; view, add the following lines of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Scripts.Render("~/bundles/isotope")
@Scripts.Render("~/bundles/custom")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should be all that you need to get the Isotope grid functioning. Note, that all the code (as mentioned above) is also &lt;a href="https://github.com/dirkstrauss/ResponsiveTables" rel="noopener noreferrer"&gt;available on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Running the Isotope Grid and Filter
&lt;/h3&gt;

&lt;p&gt;You should end up with a grid that displays &lt;strong&gt;planets&lt;/strong&gt; and &lt;strong&gt;dwarf planets&lt;/strong&gt; , but in addition to this, it also includes a filter. Clicking on the &lt;strong&gt;Planets&lt;/strong&gt; button will display just the planets while clicking on the &lt;strong&gt;Dwarf Planets&lt;/strong&gt; button will display only dwarf planets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=Jeb-cxwxs0Q" rel="noopener noreferrer"&gt;View a demo of the filtering functionality on YouTube&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another bonus is that Isotope will alter the layout of your grid items to make them fit the screen size you’re using.&lt;/p&gt;

&lt;p&gt;Note: I have not bothered rendering the filter buttons for mobile.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-isotope-mobile.jpg%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fresponsive-tables-isotope-mobile.jpg%3Fw%3D640%26ssl%3D1" alt="Responsive Tables Isotope on Mobile"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This responsiveness also does not affect the filter functionality. It remains fully functional and responsive throughout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Isotope Provides much more
&lt;/h2&gt;

&lt;p&gt;The Isotope package has a lot to offer developers. Have a look at the &lt;a href="https://isotope.metafizzy.co/filtering.html" rel="noopener noreferrer"&gt;filtering options&lt;/a&gt; available as well as &lt;a href="https://isotope.metafizzy.co/sorting.html" rel="noopener noreferrer"&gt;sorting&lt;/a&gt; and &lt;a href="https://isotope.metafizzy.co/layout-modes.html" rel="noopener noreferrer"&gt;layout modes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://dirkstrauss.com/responsive-tables/" rel="noopener noreferrer"&gt;Responsive Tables – How to scale your site beautifully&lt;/a&gt; appeared first on &lt;a href="https://dirkstrauss.com" rel="noopener noreferrer"&gt;Programming and Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Struggling With Imposter Syndrome? How To Think And Overcome</title>
      <dc:creator>Dirk Strauss</dc:creator>
      <pubDate>Wed, 12 Dec 2018 07:32:12 +0000</pubDate>
      <link>https://forem.com/dirkstrauss/struggling-with-imposter-syndrome-how-to-think-and-overcome-329p</link>
      <guid>https://forem.com/dirkstrauss/struggling-with-imposter-syndrome-how-to-think-and-overcome-329p</guid>
      <description>&lt;h2&gt;
  
  
  Struggling with Imposter Syndrome
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F11%2Fstruggling-with-imposter-syndrome.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F11%2Fstruggling-with-imposter-syndrome.jpg" alt="Struggling with imposter syndrome"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The fact is that before programmers learn how to deal with imposter syndrome, they need to know how to identify it. All too often I have heard programmers say that they would never be able to work with a specific technology.&lt;/p&gt;

&lt;h2&gt;
  
  
  Imposter Syndrome - How to Overcome It
&lt;/h2&gt;

&lt;p&gt;You feel that having your work peer reviewed will expose your lack of knowledge. Developers getting stuck in a rut is usually the result of not moving forward for fear of putting yourself out there. They never attempt to learn something new. Some programmers never move outside their comfort zone. It is for these reasons that struggling with imposter syndrome is a very real thing. Some signs that you might be struggling with imposter syndrome are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You are afraid that people important to you will see you as incapable?&lt;/li&gt;
&lt;li&gt;Do you struggle to accept compliments or praise?&lt;/li&gt;
&lt;li&gt;Does it feel like your success is due to luck?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is however a way for professionals in dealing with imposter syndrome.&lt;/p&gt;

&lt;h2&gt;
  
  
  You need a different perspective
&lt;/h2&gt;

&lt;p&gt;The raw deal with imposter syndrome is that it makes you feel isolated and excluded. In reality though, everyone has a hand in what you know. The flip side is also true, you have a hand in what everyone else knows too. Think about that for a minute. There is an overlap of knowledge between developers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F11%2Fstruggling-with-imposter-syndrome-visualization.jpeg%3Fresize%3D768%252C427%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F11%2Fstruggling-with-imposter-syndrome-visualization.jpeg%3Fresize%3D768%252C427%26ssl%3D1" alt="What I know Venn"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the first and most important step in learning how to deal with imposter syndrome. Once you realize this, you can move past how you feel and replace that with passion.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Everything around you that you call life, was made up by people that were no smarter than you. And you can change it. You can influence it. – Steve Jobs&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Start by moulding your perception of life. As it happens, you are the architect of your own destiny. It is within your reach to create the career that you want to have. All you have to do, is realize that you can.&lt;/p&gt;

&lt;h2&gt;
  
  
  Living life with passion
&lt;/h2&gt;

&lt;p&gt;I’m not saying that programmers that are struggling with imposter syndrome have a lack of passion. I’m saying that imposter syndrome is getting in the way of you living passionately.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F11%2Fpassion-lead-us-here.jpg%3Fresize%3D768%252C513%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F11%2Fpassion-lead-us-here.jpg%3Fresize%3D768%252C513%26ssl%3D1" alt="Passion led us here"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is a different breed of person that can be found in the lonely hours of the night, faces illuminated by the glow of a computer screen, vamping on technology. This breed belongs to a passionate few that consider their trade as more of an artform, than work. The fact that you are reading this article, tells me that these passionate few include &lt;strong&gt;&lt;em&gt;you&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>impostersyndrome</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Chrome Dev Tools – More Advanced Tips for Better Debugging</title>
      <dc:creator>Dirk Strauss</dc:creator>
      <pubDate>Wed, 12 Dec 2018 06:46:58 +0000</pubDate>
      <link>https://forem.com/dirkstrauss/chrome-dev-tools--more-advanced-tips-for-better-debugging-5cgh</link>
      <guid>https://forem.com/dirkstrauss/chrome-dev-tools--more-advanced-tips-for-better-debugging-5cgh</guid>
      <description>&lt;p&gt;Chrome Dev Tools – There are a few advanced debugging tips in the Chrome Browser for Web Developers that provide incredible valuable. &lt;a href="https://dev.to/dirkstrauss/chrome-developer-tools--easy-web-debugging-you-need-to-know-4bko-temp-slug-1396917"&gt;In the previous article&lt;/a&gt;, we looked at some basic debugging tips that you should know. In this article, we will delve a little deeper and see what else is available to web developers in &lt;a href="https://amzn.to/2UxaIzx" rel="noopener noreferrer"&gt;Chrome Dev Tools&lt;/a&gt; (this is an affiliate link).&lt;/p&gt;

&lt;h2&gt;
  
  
  Chrome Dev Tools makes debugging easy
&lt;/h2&gt;

&lt;p&gt;Chrome Dev Tools are a collection of web developer tools that are built directly into the Chrome Browser. You are able to make changes on the fly without recompiling your code. You can also debug and resolve issues quicker. This helps web developers build sites faster and create more stable web applications that scale across different devices properly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Looking for something else? Try these links instead:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/chrome-developer-tools--easy-web-debugging-you-need-to-know-4bko-temp-slug-1396917"&gt;Chrome Developer Tools – Easy Web Debugging You Need to Know&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dirkstrauss/sass-css--this-awesome-extension-will-make-you-sassy-3def-temp-slug-408589"&gt;Sass CSS – This Awesome Extension Will Make You Sassy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/the-unbelievably-powerful-multi-select/" rel="noopener noreferrer"&gt;The Unbelievably Powerful Multi Select. Increase Productivity Now&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Combine this with Sass CSS and you are able to style you web application easily by targeting specific breakpoints. Breakpoints are the points where your site’s content will be responsive to a specific device it’s being viewed on. The layout is then changed to provide the user with the best viewing experience possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making code look pretty
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-pretty-code-1.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-pretty-code-1.png%3Fw%3D640%26ssl%3D1" alt="Chrome Dev Tools Make Code Look Pretty"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sometimes you need to gain a bit more clarity when viewing a file in the Inspector. This is especially true for script files. Luckily you can click on the curly braces and Chrome Dev Tools will open a new file with the formatted code. In the screenshot above, you can see that I am viewing a script in the &lt;strong&gt;Sources&lt;/strong&gt; tab.&lt;/p&gt;

&lt;h2&gt;
  
  
  Throttling for slow 3G
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-network-slow-3g.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-network-slow-3g.png%3Fw%3D640%26ssl%3D1" alt="Chrome Dev Tools Network Slow 3G"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some times you need to be cognisant of the fact that some of your users will need to access your site when they do not have a fast connection. Chrome Dev Tools allows web developers to throttle their web applications to mimic slow network speeds.&lt;/p&gt;

&lt;p&gt;On the &lt;strong&gt;Network&lt;/strong&gt; tab, click on the &lt;strong&gt;Online&lt;/strong&gt; dropdown and select one of the presets or add a custom Network Throttling Profile.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding breakpoints to scripts
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-add-breakpoints.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-add-breakpoints.png%3Fw%3D640%26ssl%3D1" alt="Adding breakpoints in Chrome Dev Tools"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you need to debug one of your scripts, Chrome Dev Tools allows you to do this via the &lt;strong&gt;Sources&lt;/strong&gt; tab. Select the script in the page tree to the left and click on the line number that you want to add a breakpoint to.&lt;/p&gt;

&lt;p&gt;The next time your script is run, the code will stop at the breakpoint you set.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-debugger-controls.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-debugger-controls.png%3Fw%3D640%26ssl%3D1" alt="Chrome Dev Tools Step Controls"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To navigate your script, you can click on the step controls. These are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Resume script execution&lt;/li&gt;
&lt;li&gt;Skip the next function call&lt;/li&gt;
&lt;li&gt;Step into the next function call&lt;/li&gt;
&lt;li&gt;Jump out of the current function&lt;/li&gt;
&lt;li&gt;Step&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also  &lt;strong&gt;Deactivate breakpoints&lt;/strong&gt; and  &lt;strong&gt;Pause on exceptions&lt;/strong&gt; if required.&lt;/p&gt;

&lt;h2&gt;
  
  
  Event Listener Breakpoints
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-event-listener-breakpoints.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-event-listener-breakpoints.png%3Fw%3D640%26ssl%3D1" alt="Event listener breakpoints in Chrome Dev Tools"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another nice feature in Chrome Dev Tools is the &lt;strong&gt;Event Listener Breakpoints&lt;/strong&gt; window. This allows you to pause the code execution when a specific event listener executes.&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;Sources&lt;/strong&gt; tab, click on the &lt;strong&gt;Event Listener Breakpoints&lt;/strong&gt;  window and expand the events. You can then check the event you want to break for. When that event listener executes, Chrome Dev Tools will pause allowing you to inspect the code. &lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Expressions
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-add-expression-to-watch.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-add-expression-to-watch.png%3Fw%3D640%26ssl%3D1" alt="Chrome Dev Tools Adding Expressions To Watch Window"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Watch&lt;/strong&gt; window in Chrome Dev Tools allows web developers to add expressions. These are then added to the Watch window. You can see the values of variables currently in scope from the &lt;strong&gt;Scope&lt;/strong&gt; window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Log to the Console Window
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-console-window.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-console-window.png%3Fw%3D640%26ssl%3D1" alt="Using the Console Window in Chrome Dev Tools"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Chrome Dev Tools allows web developers to log information to the &lt;strong&gt;Console&lt;/strong&gt; window. If you add &lt;em&gt;console.log&lt;/em&gt; to your script, that information will be output to the &lt;strong&gt;Console&lt;/strong&gt; window.&lt;/p&gt;

&lt;p&gt;You can access the &lt;strong&gt;Console&lt;/strong&gt; window from the &lt;strong&gt;Console tab&lt;/strong&gt;  or as a drawer that is displayed next to any of the other windows. To open it as a dedicated &lt;strong&gt;Console&lt;/strong&gt; panel, press &lt;em&gt;Ctrl+Shift+J&lt;/em&gt; or &lt;em&gt;Cmd+Opt+J&lt;/em&gt; on Mac.&lt;/p&gt;

&lt;h2&gt;
  
  
  Save your Console Output
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-save-console-output.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-save-console-output.png%3Fw%3D640%26ssl%3D1" alt="Save Console Output in Chrome Dev Tools"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you need to save the output of your &lt;strong&gt;Console&lt;/strong&gt; window, Chrome Dev Tools allows you to do this by right-clicking and selecting &lt;strong&gt;Save as…&lt;/strong&gt; fromt eh context menu.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preserve Console History
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-preserve-console-history.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-preserve-console-history.png%3Fw%3D640%26ssl%3D1" alt="Chrome Dev Tools Preserve Console History"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Chrome Dev Tools allows web developers to preserve the Console History &lt;strong&gt;between&lt;/strong&gt; page refreshes. This option is not on by default. To enable it, click on the settings icon. Then check the &lt;strong&gt;Preserve log&lt;/strong&gt; checkbox.&lt;/p&gt;

&lt;p&gt;Messages output to the Console window will be preserved until you clear the Consol or close the tab.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing a Code Fix
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-edit-script-code.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-edit-script-code.png%3Fw%3D640%26ssl%3D1" alt="Edit code in Chrome Dev Tools"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have found a bug in your script, you can edit the code right from inside Chrome Dev Tools. You don’t need to leave Chrome Dev Tools UI to change the script code. &lt;/p&gt;

&lt;p&gt;If your code is currently paused at a breakpoint, click on the &lt;strong&gt;Resume script execution&lt;/strong&gt; button. Then add or edit the script as needed. You will notice that I just added a &lt;em&gt;console.log&lt;/em&gt; to output the word &lt;strong&gt;Hello&lt;/strong&gt;. Also notice that the file is marked as modified.&lt;/p&gt;

&lt;p&gt;To save your changes, press &lt;em&gt;Ctrl+S&lt;/em&gt; on Windows or &lt;em&gt;Command+S&lt;/em&gt; on Mac. Note that changes to this file are not saved to the file system. When you run the script again, the change I made is displayed in the &lt;strong&gt;Console&lt;/strong&gt; window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Audit Website Speed
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-run-audit.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-run-audit.png%3Fw%3D640%26ssl%3D1" alt="Run site audit in Chrome Dev Tools"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Chrome Dev Tools allows you to audit your website speed. It is recommended you browse your web page in &lt;strong&gt;Incognito&lt;/strong&gt; mode. To run your page with Incognito mode in Visual Studio, &lt;a href="https://www.hanselman.com/blog/VisualStudioWebDevelopmentTipAddChromeIncognitoModeAsABrowser.aspx" rel="noopener noreferrer"&gt;check out Scott Hanselman’s article&lt;/a&gt; on enabling this in Visual Studio.&lt;/p&gt;

&lt;p&gt;To start the audit, click on the &lt;strong&gt;Audits&lt;/strong&gt; tab. You can then set several options for your audit. You can select to audit the &lt;strong&gt;Mobile&lt;/strong&gt; version or  &lt;strong&gt;Desktop&lt;/strong&gt; version of your site.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Audits&lt;/strong&gt; option allows you to select which categories of audits to run. Because I am only interested in the performance of the site, I only selected the &lt;strong&gt;Performance&lt;/strong&gt; option.&lt;/p&gt;

&lt;p&gt;You can also throttle the page based on specific mobile device connections. Lastly, the &lt;strong&gt;Clear storage&lt;/strong&gt; option allows you to delete all storage before loading your web page. This is similar to a visitor viewing your page for the first time. To audit repeat visitors, uncheck the &lt;strong&gt;Clear storage&lt;/strong&gt; option.&lt;/p&gt;

&lt;h3&gt;
  
  
  Running your Audit
&lt;/h3&gt;

&lt;p&gt;When you are ready, click on the &lt;strong&gt;Run audits&lt;/strong&gt; button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-performance.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-performance.png%3Fw%3D640%26ssl%3D1" alt="Chrome Dev Tools Performance Metrics"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because we used simulated throttling, Chrome Dev Tools now extrapolates the time your page would load on a mobile device based on how long it would take on a desktop. It isn’t actually throttling your CPU or network.&lt;/p&gt;

&lt;p&gt;When the audit report loads, it displays your performance baseline. Your performance score is shown at the top of the report. The higher this number, the better. It also displays various metrics for your site.&lt;/p&gt;

&lt;p&gt;You can hover over a metric to learn more about it and to access the documentation for the specific metric.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-opportunities.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-opportunities.png%3Fw%3D640%26ssl%3D1" alt="Chrome Dev Tools Opportunities and Diagnostics"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lower down in the &lt;strong&gt;Opportunities&lt;/strong&gt; section, the report displays some tips to improve the performance of your site. The &lt;strong&gt;Diagnostics&lt;/strong&gt; section displays more detailed information on exactly what happened.&lt;/p&gt;

&lt;p&gt;Chrome Dev Tools Audits can give you valuable insights as to the performance and bottlenecks of your site. There is a lot more to learn here. &lt;a href="https://developers.google.com/web/tools/chrome-devtools/speed/get-started" rel="noopener noreferrer"&gt;Check out the excellent support article&lt;/a&gt; on Google’s Tools for Web Developers site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simulate Mobile Devices
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-view-mobile-devices.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-view-mobile-devices.png%3Fw%3D640%26ssl%3D1" alt="Set device mode in Chrome Dev Tools"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you need to check the responsive layout of your site across different devices, you can let Chrome Dev Tools simulate specific mobile devices.  To do this, click on the &lt;strong&gt;Toggle device toolbar&lt;/strong&gt; icon in the top left corner. You can also press &lt;em&gt;Ctrl+Shift+M&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-view-as-iphone-x.png%3Fw%3D640%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fchrome-dev-tools-view-as-iphone-x.png%3Fw%3D640%26ssl%3D1" alt="Specify specific mobile device in Chrome Dev Tools"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your browser window will now change the layout of your site as if it was being viewed on a different device. In this case I selected the iPhone X, but you can select several other devices from the dropdown.&lt;/p&gt;

&lt;p&gt;To cater for different breakpoints, you need to target these in your stylesheets. I use &lt;a href="https://dev.to/dirkstrauss/sass-css--this-awesome-extension-will-make-you-sassy-3def-temp-slug-408589"&gt;Sass CSS&lt;/a&gt; to easily target different mobile breakpoints in my stylesheets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Chrome Dev Tools provide web developers a rich set of debugging tools that enable you to fine tune your web application. There is a lot more you can do in the tools (more than I can cover in a single article). &lt;a href="https://developers.google.com/web/tools/chrome-devtools/" rel="noopener noreferrer"&gt;Have a look at the documentation&lt;/a&gt; Google provides to learn more.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://dirkstrauss.com/chrome-dev-tools-advanced-debugging-tips/" rel="noopener noreferrer"&gt;Chrome Dev Tools – More Advanced Tips for Better Debugging&lt;/a&gt; appeared first on &lt;a href="https://dirkstrauss.com" rel="noopener noreferrer"&gt;Programming and Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>howto</category>
      <category>debuggingtools</category>
      <category>developertools</category>
      <category>testmobilelayouts</category>
    </item>
    <item>
      <title>Chrome Developer Tools – Easy Web Debugging You Need to Know</title>
      <dc:creator>Dirk Strauss</dc:creator>
      <pubDate>Wed, 05 Dec 2018 06:38:25 +0000</pubDate>
      <link>https://forem.com/dirkstrauss/chrome-developer-tools--easy-web-debugging-you-need-to-know-30na</link>
      <guid>https://forem.com/dirkstrauss/chrome-developer-tools--easy-web-debugging-you-need-to-know-30na</guid>
      <description>&lt;p&gt;Chrome Developer Tools – As a web developer, one tool that is invaluable is the Chrome Developer Tools. It is a feature rich set of tools that you can use directly from your Chrome Browser. In this article, I will have a look at four Chrome Developer Tools in particular.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chrome Developer Tools
&lt;/h2&gt;

&lt;p&gt;Creating web applications pose specific challenges for developers. It isn’t always possible to stick to pure C# debugging in Visual Studio, especially when you are creating a responsive UI. The project below uses &lt;a href="https://amzn.to/2U9GJ0a" rel="noopener noreferrer"&gt;SASS&lt;/a&gt; that compiles to &lt;a href="https://amzn.to/2SpB8kJ" rel="noopener noreferrer"&gt;CSS&lt;/a&gt;. To open the Chrome Developer Tools, you obviously need to be using Chrome as your browser. Right click anywhere on your web page (or on an element) and select the &lt;strong&gt;Inspect&lt;/strong&gt; menu option in your context menu. You can also hold down &lt;strong&gt;Ctrl+Shift+I&lt;/strong&gt;. You can &lt;a href="https://github.com/dirkstrauss/ChromeDevToolsDemo" rel="noopener noreferrer"&gt;download the code from my GitHub repository&lt;/a&gt; if you want to follow along.&lt;/p&gt;

&lt;h3&gt;
  
  
  Looking for something else? Try these links instead:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/chrome-dev-tools-advanced-debugging-tips/" rel="noopener noreferrer"&gt;Chrome Dev Tools – More Advanced Tips for Better Debugging&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/sass-css-sassy-websites" rel="noopener noreferrer"&gt;Sass CSS – This Awesome Tool Will Make You Sassy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/the-unbelievably-powerful-multi-select/" rel="noopener noreferrer"&gt;The Unbelievably Powerful Multi Select. Increase Productivity Now&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/windows-task-manager/" rel="noopener noreferrer"&gt;Windows Task Manager – Resolve High Disk Usage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/resizing-virtualbox-disks/" rel="noopener noreferrer"&gt;Resizing VirtualBox Disks Does Not Work With Snapshots&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. Drag and Drop Elements
&lt;/h2&gt;

&lt;p&gt;Did you know that you can select specific elements on your web page and drag them around to see what they look like in different positions on the web page you are creating? Simply click and hold the element and drag it to a new position.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fdrag_drop_elements.gif%3Fresize%3D640%252C428%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fdrag_drop_elements.gif%3Fresize%3D640%252C428%26ssl%3D1" alt="Drag and drop elements"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is really great if you want to move things around a bit without having to go back to Visual Studio and changing the markup there. As a side note, if you have not looked at what SASS has to offer, &lt;a href="https://sass-lang.com/" rel="noopener noreferrer"&gt;I encourage you to do so&lt;/a&gt;. It has really changed my life (I know it sounds really geeky) and now &lt;a href="https://dirkstrauss.com/sass-css-sassy-websites" rel="noopener noreferrer"&gt;I can’t imagine working without SASS&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Adding CSS
&lt;/h2&gt;

&lt;p&gt;Another nice trick is to add CSS to your elements right in the inspector. Chrome Developer Tools makes this really easy by allowing you to select your element and click on the plus icon. You can then add a specific CSS property to your element.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fadd_css.gif%3Fresize%3D640%252C428%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fadd_css.gif%3Fresize%3D640%252C428%26ssl%3D1" alt="Adding CSS to an Element"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This allows you to get a feel for what your element will look like if you add specific CSS properties to it.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Adding a Class
&lt;/h2&gt;

&lt;p&gt;In my project, I have a new class called redButton. All it does is sets the background color to red. To see how an element is affected when applying the class to it, select the element and click on the &lt;strong&gt;.cls&lt;/strong&gt; toggle. As you type, the class is found and when you hit &lt;strong&gt;Enter&lt;/strong&gt; , the class is applied. This will style the element immediately. Furthermore, you can then hover over the class name added in the &lt;strong&gt;Styles&lt;/strong&gt; window, hold down &lt;strong&gt;Ctrl+Click&lt;/strong&gt; and go to the file that contains the class you added. Hovering over the tab will show you the location of the file in your project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fadd_class.gif%3Fresize%3D640%252C428%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Fadd_class.gif%3Fresize%3D640%252C428%26ssl%3D1" alt="Adding a class to css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you need to make changes to the class, you can use this method to easily find the containing file.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Triggering State
&lt;/h2&gt;

&lt;p&gt;A particular tricky thing to do is mimic states. Chrome Developer Tools allows you to trigger the state of an element. In this example we are triggering the hover state of a button. We can then change the CSS as needed to see what effect the changes have on the hover state (for example) .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Ftrigger_state.gif%3Fresize%3D640%252C428%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi1.wp.com%2Fdirkstrauss.com%2Fwp-content%2Fuploads%2F2018%2F12%2Ftrigger_state.gif%3Fresize%3D640%252C428%26ssl%3D1" alt="Triggering State"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can easily modify element states without having to blindly change the CSS and hope that it is applied correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Chrome Developer Tools give web developers a host of options for debugging the UI. When you use these these tools in conjunction with each other, you can easily change elements styles on the fly.&lt;/p&gt;

&lt;p&gt;For mre on this topic, check out &lt;a href="https://dirkstrauss.com/chrome-dev-tools-advanced-debugging-tips/" rel="noopener noreferrer"&gt;my second article on Chrome Developer Tools&lt;/a&gt; that goes a little more in depth.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://dirkstrauss.com/chrome-developer-tools-easy-web-debugging/" rel="noopener noreferrer"&gt;Chrome Developer Tools – Easy Web Debugging You Need to Know&lt;/a&gt; appeared first on &lt;a href="https://dirkstrauss.com" rel="noopener noreferrer"&gt;Programming and Tech Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>howto</category>
      <category>chromedevelopercon</category>
      <category>chromedevelopertoo</category>
      <category>chromeinspecteleme</category>
    </item>
    <item>
      <title>Sass CSS – This Awesome Extension Will Make You Sassy</title>
      <dc:creator>Dirk Strauss</dc:creator>
      <pubDate>Tue, 04 Dec 2018 06:58:18 +0000</pubDate>
      <link>https://forem.com/dirkstrauss/sass-css--this-awesome-extension-will-make-you-sassy-35m0</link>
      <guid>https://forem.com/dirkstrauss/sass-css--this-awesome-extension-will-make-you-sassy-35m0</guid>
      <description>

&lt;p&gt;Sass CSS – If you develop web applications and you have &lt;a href="https://sass-lang.com/"&gt;not heard about Sass&lt;/a&gt;, then today is your lucky day. To quote a note from the Sass website, it is the most mature, stable and powerful professional grade CSS extension language in the world.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sass CSS
&lt;/h2&gt;

&lt;p&gt;If you have ever had to work with CSS, you will love Sass. It is a feature rich CSS extension language. Sass CSS is also completely compatible with all CSS versions. It has actively been supported for many years and it is safe to say that it is widely adopted. What Sass will do is enable you to write CSS using Sass and have it compile into CSS when you save. You can also create a minified CSS file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Looking for something else? Try these links instead:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/cool-life-hacks-using-simple-technology/"&gt;Cool Life Hacks using Simple Technology Hacks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/email-automation-microsoft-flow-automate-outlook/"&gt;Email Automation Microsoft Flow – Automating Outlook.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dirkstrauss.com/automate-trello-using-devops-wunderlist/"&gt;Automate Trello using DevOps and Wunderlist&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Adding to Visual Studio
&lt;/h2&gt;

&lt;p&gt;If you are creating web applications in Visual Studio, you need to do the following to add Sass CSS to your project. Below you will see that I have a normal MVC web application. I am going to add Sass CSS to this project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3bi9wtGQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-demo-project.png%3Fresize%3D420%252C465%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3bi9wtGQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-demo-project.png%3Fresize%3D420%252C465%26ssl%3D1" alt="sass css demo project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a folder in your project called &lt;strong&gt;scss&lt;/strong&gt;. This is where you are going to add all your scss files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HenHc5yt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-add-scss-folder.png%3Fresize%3D420%252C465%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HenHc5yt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-add-scss-folder.png%3Fresize%3D420%252C465%26ssl%3D1" alt="Adding the SCSS Folder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Right-click on the folder and add a new item. You might also see &lt;strong&gt;SCSS Style Sheet (SASS)&lt;/strong&gt; as an option in the context menu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k4jyvJPp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-add-scss-file.png%3Fresize%3D336%252C406%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k4jyvJPp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-add-scss-file.png%3Fresize%3D336%252C406%26ssl%3D1" alt="Adding the SCSS file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add the scss file and call it &lt;strong&gt;custom.scss&lt;/strong&gt;. You can name it anything you like, just be sure to carry that through when looking at the examples in this article.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rl7s4S7I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-file-added.png%3Fresize%3D420%252C465%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rl7s4S7I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-file-added.png%3Fresize%3D420%252C465%26ssl%3D1" alt="SCSS file added"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding the Web Compiler
&lt;/h2&gt;

&lt;p&gt;We need to be able to compile the Sass CSS file into a CSS file. To do this, in Visual Studio from the &lt;strong&gt;Tools&lt;/strong&gt; menu click on &lt;strong&gt;Extensions and Updates&lt;/strong&gt;. Perform a search for &lt;strong&gt;Web Compiler&lt;/strong&gt; created by Mads Kristensen and install that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--773UZoVs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-add-web-compiler.png%3Fresize%3D640%252C445%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--773UZoVs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-add-web-compiler.png%3Fresize%3D640%252C445%26ssl%3D1" alt="Adding the Web Compiler"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now compile the Sass CSS file by right-clicking it and selecting &lt;strong&gt;Web Compiler&lt;/strong&gt; and then clicking on &lt;strong&gt;Compile file&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BwHby51M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-compile-file.png%3Fresize%3D555%252C710%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BwHby51M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-compile-file.png%3Fresize%3D555%252C710%26ssl%3D1" alt="Compile the SCSS file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see that the compiler creates a &lt;strong&gt;compilerconfig.json&lt;/strong&gt; file as well as a &lt;strong&gt;custom.css&lt;/strong&gt; and &lt;strong&gt;custom.min.css&lt;/strong&gt; file. That is great, but I don’t want to have my CSS files output to the same location as my Sass CSS file. Let’s change that behavior.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oy7Rv015--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-locate-compiler-config-file.png%3Fresize%3D376%252C541%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oy7Rv015--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-locate-compiler-config-file.png%3Fresize%3D376%252C541%26ssl%3D1" alt="Locate compiler config file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Changing the CSS File Output Location
&lt;/h2&gt;

&lt;p&gt;Open the &lt;strong&gt;compilerconfig.json&lt;/strong&gt; file. You will notice that it contains the input location and output location of your files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rQe76-MA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-compiler-config-file-before-edit.png%3Fresize%3D361%252C129%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rQe76-MA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-compiler-config-file-before-edit.png%3Fresize%3D361%252C129%26ssl%3D1" alt="Before editing compiler config file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Modify the &lt;strong&gt;outputFile&lt;/strong&gt; path to the Content folder. For the purposes of this article I will stick with the Content folder, but you can change the path to wherever you are storing your web application’s CSS files. You can also name your output CSS file whatever you like. I have just kept mine &lt;strong&gt;custom.css&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9CdmxgbI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-compiler-config-file-after-edit.png%3Fresize%3D384%252C135%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9CdmxgbI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-compiler-config-file-after-edit.png%3Fresize%3D384%252C135%26ssl%3D1" alt="After editing compiler config file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you save your &lt;strong&gt;compilerconfig.json&lt;/strong&gt; file, you will notice that the Web Compiler does a build again and the CSS file is output to the path that you specified. You will also notice that the Web Compiler has created the minified CSS file for you too. You can now delete the CSS files created earlier in the Sass CSS folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--giRLnJmI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-custom-css-output.png%3Fresize%3D376%252C682%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--giRLnJmI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-custom-css-output.png%3Fresize%3D376%252C682%26ssl%3D1" alt="Generated custom css file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the Sass CSS FIle
&lt;/h2&gt;

&lt;p&gt;Open up the &lt;strong&gt;custom.scss&lt;/strong&gt; file and delete the contents. Add a new class called &lt;strong&gt;.redButton&lt;/strong&gt; and set the background color to red.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vw3oNeim--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-edit-custom-scss-file.png%3Fresize%3D324%252C86%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vw3oNeim--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-edit-custom-scss-file.png%3Fresize%3D324%252C86%26ssl%3D1" alt="Edit scss file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, head on over to your &lt;strong&gt;Index.cshtml&lt;/strong&gt; View and add the &lt;strong&gt;redButton&lt;/strong&gt; class to an element on your page. I added the class to a button on my page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lZNUgqIf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-edit-index-view.png%3Fresize%3D637%252C245%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lZNUgqIf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-edit-index-view.png%3Fresize%3D637%252C245%26ssl%3D1" alt="Add custom class to Index View"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Swing back to the &lt;strong&gt;App_Start&lt;/strong&gt; folder and locate the &lt;strong&gt;BundleConfig.cs&lt;/strong&gt; file. Add the &lt;strong&gt;custom.css&lt;/strong&gt; file to the &lt;strong&gt;StyleBundle&lt;/strong&gt; class.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GNZpVjLs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-edit-bundleconfig-file.png%3Fresize%3D603%252C516%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GNZpVjLs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-edit-bundleconfig-file.png%3Fresize%3D603%252C516%26ssl%3D1" alt="Edit BundleConfig file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Build your Web Application and run it. You will see that the familliar Jumbotron button is styled red instead of its default blue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UIt2slbS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-run-project.png%3Fresize%3D528%252C664%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UIt2slbS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/dirkstrauss.com/wp-content/uploads/2018/12/sass-css-run-project.png%3Fresize%3D528%252C664%26ssl%3D1" alt="Debug web application"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Sass CSS is a fantastic way to create custom CSS styles for your web application. There is a lot more to show you, so stick around. There will be more articles on Sass CSS in the coming weeks.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://dirkstrauss.com/sass-css-sassy-websites/"&gt;Sass CSS – This Awesome Extension Will Make You Sassy&lt;/a&gt; appeared first on &lt;a href="https://dirkstrauss.com"&gt;Programming and Tech Blog&lt;/a&gt;.&lt;/p&gt;


</description>
      <category>howto</category>
      <category>differencebetweens</category>
      <category>generatecssfiles</category>
      <category>minifycssfiles</category>
    </item>
  </channel>
</rss>
