SlideShare a Scribd company logo
LessSass done right in .NET


 Pawel Pabich, Senior Consultant at Readify
        blog: www.pabich.eu/blog
          twitter: @pawelpabich
         email: pawel@pabich.eu
Why even bother with Less/Sass?


Css is a factory of
code duplication
Why ?

• No nesting
• No variables
• No functions
Nesting
Variables
Functions
Less/Sass in Visual Studio
• Chirpy (open source)
  • Code generation for Less and Sass
• Mindscape Web Workbench (commercial)
  • Syntax highlighting(free)
  • Intellisense (free)
  • Code generation for Sass(free) and Less (paid)
• Don’t use both at the same time
Problems with design time generation
• Both, source of truth (less/sass) and
  autogenerated code (css) stored in source
  control and they can get out of sync
• All depended files need to be re-saved when a
  base file gets changed
• Can be solved at build time if the same tool is
  used inside VS and during the build
• Or we can follow RoR guys and do it at
  runtime  which is the most flexible soluiton
Generation of css at runtime 1/2
• Mindscape Web Workbench command line
  compiler
  • Same code as what runs inside their VS extension
  • Uses less.js and V8 exposed via a managed
    wrapper
  • 32 bit only, so needs to be run as an external
    process for 64 bit hosts
• DotLess
  • Fully managed implementation
  • Does not seem to handle relative imports !!!
Generation of css at runtime 2/2
• Nodejs and less package
  • Needs to be run out of process
  • Files created by VS need to be converted to UTF-
    without BOM (byte order mark)
What about Sass ?
• Ruby Sass compiler is veryyyyy slow on
  Windows, eg. 400 lines of Sass takes 30-40sec
• There is no managed equivalent
• There is a C/C++ version in the works but not
  yet complete https://github.com/hcatlin/sassc
Sample transforms
https://github.com/pawelpabich/SampleBundleI
mplementationsForLess
Links
• DotLess – http://www.dotlesscss.org/
• Nodejs – http://nodejs.org/
• Less – http://lesscss.org/
• Sass - http://sass--lang.-com
• Mindscapee workbench -
  http://visualstudiogallery.msdn.microsoft.com
  /2b96d16a-c986-4501-8f97-8008f9db141a
• Chirpy - http://chirpy.codeplex.com/

More Related Content

PDF
Why use Go for web development?
PDF
Migrate PHP E-Commerce Site to Go
PPTX
Coding for the cloud - development of modern web applications
PPTX
1 pluginable laravel cms
PPTX
Blazor - .NET in the Browser!
PPTX
Through Meteor to the stars - Developing full-stack SPA's with meteor.js
PDF
JSFoo-2017 Takeaways
PDF
Python to go
Why use Go for web development?
Migrate PHP E-Commerce Site to Go
Coding for the cloud - development of modern web applications
1 pluginable laravel cms
Blazor - .NET in the Browser!
Through Meteor to the stars - Developing full-stack SPA's with meteor.js
JSFoo-2017 Takeaways
Python to go

What's hot (20)

PPT
Next generation frontend tooling
PPTX
Web Assembly Big Picture
PDF
Fast Web Applications with Go
PDF
Riak at Posterous
PPTX
Untangling spring week11
PPTX
Breaking the eggshell: From .NET to Node.js
PDF
A look at FastCgi & Mod_PHP architecture
PDF
About Caching
KEY
Ship It ! with Ruby/ Rails Ecosystem
PDF
2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...
PPTX
PHP, LAMP Stack & WordPress
PDF
WebAssembly vs JavaScript: What is faster?
PDF
Beyond Apache: Faster Web Servers
PDF
Conquering AngularJS Limitations
PDF
Lessons in Open Source from the MongooseJS ODM
PPTX
Untangling spring week9
PPTX
Untangling spring week10
PPTX
Performance testing with VSTs on- and off-premises
PDF
WordPress: Getting Under the Hood
PDF
MongoDB MEAN Stack Webinar October 7, 2015
Next generation frontend tooling
Web Assembly Big Picture
Fast Web Applications with Go
Riak at Posterous
Untangling spring week11
Breaking the eggshell: From .NET to Node.js
A look at FastCgi & Mod_PHP architecture
About Caching
Ship It ! with Ruby/ Rails Ecosystem
2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...
PHP, LAMP Stack & WordPress
WebAssembly vs JavaScript: What is faster?
Beyond Apache: Faster Web Servers
Conquering AngularJS Limitations
Lessons in Open Source from the MongooseJS ODM
Untangling spring week9
Untangling spring week10
Performance testing with VSTs on- and off-premises
WordPress: Getting Under the Hood
MongoDB MEAN Stack Webinar October 7, 2015
Ad

Similar to Less\sass done right in .NET (20)

PDF
PechaKucha Less VS Sass
PPT
PPTX
SASS is more than LESS
PPTX
LESS vs. SASS
PPT
An Introduction to CSS Preprocessors (SASS & LESS)
PDF
Less vs sass
PPTX
Revamp Your Stylesheet
KEY
Future of Sass
PPTX
PDF
A better CSS: Sass and Less - CC FE & UX
PDF
Less(CSS Pre Processor) Introduction
PDF
LESS(CSS Pre Processor) introduction
PPT
CSS előfeldolgozók
PDF
LESS is More (ChiHTML5 Meetup June 2016)
PDF
LESS CSS
PDF
Using Sass in Your WordPress Projects
PPTX
CSS Preprocessors with an introduction to LESS/SASS
PPTX
Elegant CSS Design In Drupal: LESS vs Sass
PPTX
SCSS Implementation
PDF
CSS Less framework overview, Pros and Cons
PechaKucha Less VS Sass
SASS is more than LESS
LESS vs. SASS
An Introduction to CSS Preprocessors (SASS & LESS)
Less vs sass
Revamp Your Stylesheet
Future of Sass
A better CSS: Sass and Less - CC FE & UX
Less(CSS Pre Processor) Introduction
LESS(CSS Pre Processor) introduction
CSS előfeldolgozók
LESS is More (ChiHTML5 Meetup June 2016)
LESS CSS
Using Sass in Your WordPress Projects
CSS Preprocessors with an introduction to LESS/SASS
Elegant CSS Design In Drupal: LESS vs Sass
SCSS Implementation
CSS Less framework overview, Pros and Cons
Ad

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Cloud computing and distributed systems.
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
KodekX | Application Modernization Development
Building Integrated photovoltaic BIPV_UPV.pdf
The AUB Centre for AI in Media Proposal.docx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Cloud computing and distributed systems.
Digital-Transformation-Roadmap-for-Companies.pptx
Empathic Computing: Creating Shared Understanding
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25 Week I
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Programs and apps: productivity, graphics, security and other tools
The Rise and Fall of 3GPP – Time for a Sabbatical?
Mobile App Security Testing_ A Comprehensive Guide.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
Reach Out and Touch Someone: Haptics and Empathic Computing
Per capita expenditure prediction using model stacking based on satellite ima...

Less\sass done right in .NET

  • 1. LessSass done right in .NET Pawel Pabich, Senior Consultant at Readify blog: www.pabich.eu/blog twitter: @pawelpabich email: pawel@pabich.eu
  • 2. Why even bother with Less/Sass? Css is a factory of code duplication
  • 3. Why ? • No nesting • No variables • No functions
  • 7. Less/Sass in Visual Studio • Chirpy (open source) • Code generation for Less and Sass • Mindscape Web Workbench (commercial) • Syntax highlighting(free) • Intellisense (free) • Code generation for Sass(free) and Less (paid) • Don’t use both at the same time
  • 8. Problems with design time generation • Both, source of truth (less/sass) and autogenerated code (css) stored in source control and they can get out of sync • All depended files need to be re-saved when a base file gets changed • Can be solved at build time if the same tool is used inside VS and during the build • Or we can follow RoR guys and do it at runtime  which is the most flexible soluiton
  • 9. Generation of css at runtime 1/2 • Mindscape Web Workbench command line compiler • Same code as what runs inside their VS extension • Uses less.js and V8 exposed via a managed wrapper • 32 bit only, so needs to be run as an external process for 64 bit hosts • DotLess • Fully managed implementation • Does not seem to handle relative imports !!!
  • 10. Generation of css at runtime 2/2 • Nodejs and less package • Needs to be run out of process • Files created by VS need to be converted to UTF- without BOM (byte order mark)
  • 11. What about Sass ? • Ruby Sass compiler is veryyyyy slow on Windows, eg. 400 lines of Sass takes 30-40sec • There is no managed equivalent • There is a C/C++ version in the works but not yet complete https://github.com/hcatlin/sassc
  • 13. Links • DotLess – http://www.dotlesscss.org/ • Nodejs – http://nodejs.org/ • Less – http://lesscss.org/ • Sass - http://sass--lang.-com • Mindscapee workbench - http://visualstudiogallery.msdn.microsoft.com /2b96d16a-c986-4501-8f97-8008f9db141a • Chirpy - http://chirpy.codeplex.com/

Editor's Notes

  • #2: The code will be on my blog and githubIs there anybody that doesn’t know abot Less/Sass?Is there anybody that would still use Css if Less or Sass were natively supported by all web browsers?
  • #3: CSS does not even resemble a programming langue which means results in massive code duplication
  • #5: Note how classOne is repeted multiple times
  • #6: It does not seem like we have much code duplication here but let’s say we want to change secondory color from red to blue. With css, unless we have comments we dont know which red is primary and which one is secondary so we can’t really search and repleace red with blue
  • #7: Again, imagine you want to add another prefix or remove one. You have to scan all files and find all places where you use border-radius. Let’s be honest: Global search and replace is rarly a good idea 
  • #8: Show go to definitionWhat is a problem with genereting css directly in VS?Personally I think that keeping auto-generated files in the source control is a bad idea. The main reason behind it is that the source of truth (Less) can diverge from its auto-generated counterpart (Css).
  • #10: Show tranform based on Mindscape Compiler in 32bit and then DotLess with wired paths
  • #11: So there is no perfect solution yet, personally I belive Mindscape is the best package
  • #12: Iron Ruby is slow and second thing ruby is slow on WindowsTwice as many lines of Less takes half a secondC/C++ same guys that developed Ruby version but this time their goal is speed and mutli platform support