SlideShare uma empresa Scribd logo
1 de 14
Oh No You Di’int: 
Modular CSS with Sass 
in Cascade Server 
Eric L. Epps 
@ericepps
Overview 
Why to use Sass (SCSS syntax) 
Modular Sass 
Managing (S)CSS in Cascade Server 
Code!
Remember This?
Why SASS? 
Variables 
Nesting 
Mixins 
Extend/Inheritance 
Operators 
Partials/Import
Why SASS? 
Variables 
http://sass-lang.com/guide
Why SASS? 
Nesting 
http://sass-lang.com/guide
Why SASS? 
Mixins 
http://sass-lang.com/guide
Why SASS? 
Extend/Inheritance 
http://sass-lang.com/guide
Why SASS? 
Operators 
http://sass-lang.com/guide
Why SASS? 
Partials/Import 
http://sass-lang.com/guide
Requirements 
Compile SCSS 
Modular for content re-use 
Minify CSS 
Easily publish changes 
In Cascade Server
Modules 
Code 
Rendered 
SCSS 
Page 
SCSS Site 
PHP 
Compile SCSS 
Minify CSS 
Cascade 
Web Services 
Target Site 
CSS File 
Pages 
Website
Links 
https://github.com/ericepps/Cascade- 
Server-SCSS 
@ericepps 
eric.epps@svcc.edu

Mais conteúdo relacionado

Destaque (20)

Crown capital management
Crown capital managementCrown capital management
Crown capital management
 
Síntesis de evaluación
Síntesis de evaluaciónSíntesis de evaluación
Síntesis de evaluación
 
La inteligencia
La inteligenciaLa inteligencia
La inteligencia
 
Spjaldtölvur í námi og kennslu
Spjaldtölvur í námi og kennsluSpjaldtölvur í námi og kennslu
Spjaldtölvur í námi og kennslu
 
Datafashion AA&F
Datafashion AA&FDatafashion AA&F
Datafashion AA&F
 
Apartheid system
Apartheid systemApartheid system
Apartheid system
 
Velocity 2014 - From Hero to Zero
Velocity 2014 - From Hero to ZeroVelocity 2014 - From Hero to Zero
Velocity 2014 - From Hero to Zero
 
Gangguan pada Sistem Peredaran Darah
Gangguan pada Sistem Peredaran DarahGangguan pada Sistem Peredaran Darah
Gangguan pada Sistem Peredaran Darah
 
Pres4 blogger
Pres4 bloggerPres4 blogger
Pres4 blogger
 
00058
0005800058
00058
 
Clasificación del ambiente Marino
Clasificación del ambiente MarinoClasificación del ambiente Marino
Clasificación del ambiente Marino
 
VIDBOX_-Overview-june-15-2015
VIDBOX_-Overview-june-15-2015VIDBOX_-Overview-june-15-2015
VIDBOX_-Overview-june-15-2015
 
Playground Sessions Creative Brief
Playground Sessions Creative BriefPlayground Sessions Creative Brief
Playground Sessions Creative Brief
 
Green demo ptt
Green demo pttGreen demo ptt
Green demo ptt
 
Presentation1
Presentation1Presentation1
Presentation1
 
Okkar mál í Fellahverfi - nóvember 2013
Okkar mál í Fellahverfi - nóvember 2013Okkar mál í Fellahverfi - nóvember 2013
Okkar mál í Fellahverfi - nóvember 2013
 
The Imaginator: Alexandria T. Pham's Visual Resume
The Imaginator: Alexandria T. Pham's Visual ResumeThe Imaginator: Alexandria T. Pham's Visual Resume
The Imaginator: Alexandria T. Pham's Visual Resume
 
Welcome back
Welcome backWelcome back
Welcome back
 
5 Unbelievable Tricks to Help You COPE
5 Unbelievable Tricks to Help You COPE5 Unbelievable Tricks to Help You COPE
5 Unbelievable Tricks to Help You COPE
 
Vaxtasprotar tungumalatorg
Vaxtasprotar tungumalatorgVaxtasprotar tungumalatorg
Vaxtasprotar tungumalatorg
 

Último

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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 DiscoveryTrustArc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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.pdfsudhanshuwaghmare1
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Último (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
+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...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Modular CSS with Sass in Cascade Server

Notas do Editor

  1. Hello, my name is Eric Epps, and this is “Oh No You Di’int: Modular CSS with Sass in Cascade Server.” To start, I just want to take a quick poll: How many are using Sass already? Hello, my name is Eric Epps, and this is “Oh No You Di’int: Modular CSS with Sass in Cascade Server.” To start, I just want to take a quick poll: How many are using Sass already?
  2. OK, then, what we’re going to cover today is a brief overview of Sass and how it can make your life a little bit easier. As a side note, I’ll be using the SCSS syntax. I think it’s easier to get started that way, since your existing CSS files are valid SCSS. Then we’ll look at making your Sass code modular. Finally, I’ll demonstrate the system I’ve developed for managing Sass and CSS stylesheets in Cascade Server and release the code for you to check out.
  3. All right, then, let’s get started! I remember how excited I was when I first heard about CSS. You mean I don’t have to use a font tag in every cell of this table? I can just define my styles once for the whole site? I’m in! This is a pretty tame example, but it was from one of the first sites I worked on; I was able to pull the old code from the Wayback Machine.
  4. But, after a while, as CSS got more advanced and my code got more and more complex, some of that excitement started to turn to frustration. Why do I have to type all this out? I have to look through HOW MANY lines of code to make this one little change? So, finally, after hearing about how amazing LESS and Sass are, I decided to give it a try. Here’s a brief overview of what Sass allows you to do. We’ll look at Variables, Nesting, Mixins, Extensions & Inheritance, Operators, and Partials & Imports. I’m pulling all these examples directly from the Sass website, which goes into more detail as well.
  5. Variables are really useful, for example, when you want to define a color palette to reuse throughout a site or, as this sample demonstrates, fonts. You can define the variable and then reference that variable in your style sheet. So, when it’s time to update your colors or fonts or whatever, you only have to change it once.
  6. Nesting is one of my favorite features. It makes for much cleaner code by allowing selectors to be nested inside parents. When it’s parsed, it will append all the parent selectors, but I find it to be much easier to organize code this way.
  7. Mixins work kind of like a function. They’re especially useful for vendor prefixes, allowing you to use one definition for several.
  8. Extensions, or inheritance, allows for one rule to include other rules and then add or modify a couple things. For example, if you have an alert box that could be different colors, you don’t have to assign two classes or retype the rule multiple times, you can just extend the first rule to add or modify the rule.
  9. Operators make math easier. By mixing for example fluid and relative units, you can make the Sass processor do that work for you. You can also do some of this directly in your CSS with calc() in CSS3.
  10. Finally, with partials and import, you can create smaller SCSS files and include them in your main file. Since the imports are handled by the preprocessor, you don’t have the added latency of loading several CSS files in your page but you can break your code up into more manageable chunks—modules—and use them as building blocks to build, mix and match, your CSS file.
  11. So now, we’re to Modular CSS using SASS. You can, like my kids’ latest obsession, LEGO, use these modules as building blocks to build your CSS file. In Sass, you can name the files starting with an underscore, and then you can include them just by typing the file name without the underscore or the .scss, saving you from typing those 6 extra characters. Think of the time you’ll save! For a while, I used Koala for a compiler and uploaded the compiled CSS file into Cascade. Which worked pretty well. But I effectively had two code bases. If I made a quick change to the CSS file in Cascade, I’d need to remember to open it on my computer and edit the file there as well. I wanted a better solution, and one that was in Cascade Server. Jason Aller has another solution he presented last year using Grunt, but I just wanted to take a different approach and use some of the tools in Cascade.
  12. So here are the requirements I set for myself. Obviously, I wanted it to be able to compile the SCSS. I also wanted to be able to use SCSS modules so I could mix-and-match them for my CSS files. I also thought it would be nice to be able to minify the CSS while I’m at it. I wanted to be able to easily publish changes all from one location. And I wanted it to be all managed inside Cascade Server, in one code base.
  13. First let’s look at a diagram of how it works, and then we’ll dive into a demo. I set up all the SCSS in a separate site, to keep it central. In that site, there are modules (which are just file assets), which can be combined with some additional CSS code in a Page with a Data Definition. All of that content is combined and rendered in the Layout pane as a form. This form posts to a PHP script which is going to process the SCSS code, compile it, minify it, update the target CSS file asset with the compiled CSS, and publish the target CSS. What’s great then, is that these assets are all linked in the Relationships tab. If I look at a target CSS file, I can see what SCSS page is linked. Or I can see what pages use a specific module or vice-versa.