SlideShare a Scribd company logo
1 of 13
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

What's hot

Beyond Apache: Faster Web Servers
Beyond Apache: Faster Web ServersBeyond Apache: Faster Web Servers
Beyond Apache: Faster Web Servers
webhostingguy
 

What's hot (20)

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

Similar to Less\sass done right in .NET

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

Sass is dead
Sass is deadSass is dead
Sass is dead
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
 
Php on Windows
Php on WindowsPhp on Windows
Php on Windows
 
No More Cowboy Coding: Modern WordPress Development Workflow That Scales
No More Cowboy Coding: Modern WordPress Development Workflow That ScalesNo More Cowboy Coding: Modern WordPress Development Workflow That Scales
No More Cowboy Coding: Modern WordPress Development Workflow That Scales
 
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWSCloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
 
Blazor.pptx
Blazor.pptxBlazor.pptx
Blazor.pptx
 
LESS CSS
LESS CSSLESS CSS
LESS CSS
 
ASP.NET Core - Phillosophies, Processes and Tooling
ASP.NET Core - Phillosophies, Processes and ToolingASP.NET Core - Phillosophies, Processes and Tooling
ASP.NET Core - Phillosophies, Processes and Tooling
 
The Three Musketeers
The Three MusketeersThe Three Musketeers
The Three Musketeers
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
TypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San Jose
TypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San JoseTypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San Jose
TypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San Jose
 
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
 
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1
 
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
 
Release Management with Visual Studio Team Services and Office Dev PnP
Release Management with Visual Studio Team Services and Office Dev PnPRelease Management with Visual Studio Team Services and Office Dev PnP
Release Management with Visual Studio Team Services and Office Dev PnP
 
Improved development workflows using vagrant
Improved development workflows using vagrantImproved development workflows using vagrant
Improved development workflows using vagrant
 
O365Con18 - Working with PowerShell, VS Code and GitHub - Thomas Vochten
O365Con18 - Working with PowerShell, VS Code and GitHub - Thomas VochtenO365Con18 - Working with PowerShell, VS Code and GitHub - Thomas Vochten
O365Con18 - Working with PowerShell, VS Code and GitHub - Thomas Vochten
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
 
A brief intro to nodejs
A brief intro to nodejsA brief intro to nodejs
A brief intro to nodejs
 
BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

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

  1. 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?
  2. CSS does not even resemble a programming langue which means results in massive code duplication
  3. Note how classOne is repeted multiple times
  4. 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
  5. 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 
  6. 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).
  7. Show tranform based on Mindscape Compiler in 32bit and then DotLess with wired paths
  8. So there is no perfect solution yet, personally I belive Mindscape is the best package
  9. 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