Cascading Style Sheets

Transcript

00:06
While you're learning all the various ways to control things in your Q-SYS installation, you'll eventually realize something slightly terrifying.
00:14
You have to let other people touch your controls.
00:18
That's right.
00:19
Humans, the worst thing to ever happen to good code.
00:23
The most common way to build a user control interface or UCI is to simply drag in the relevant controls,
00:30
adjust their size and color to your liking, and then let those humans poke and prod your screen with their little human fingers.
00:39
We've got tons of videos in the Q-SYS level one course on how to build those UCI's style, the controls, add images, all the good stuff.
00:48
So head there if you wanna learn the basics, but there's another way to make your UCI look sleek and professional.
00:55
That doesn't involve manually setting every single color and font and background one by one.
01:01
Now sure, that is fine for a single small UCI, but for systems with multiple UCIs and multiple pages,
01:09
adhering to your marketing team's brilliant decision of changing the corporate blue to slightly different corporate blue could be an all day job.
01:20
That's when it's time to use CSS or cascading style sheets.
01:25
CSS has been around for a long time, and it's not unique to Q-SYS.
01:29
It's the same stuff used on websites everywhere.
01:32
For instance, HTML may be used to define the content of a website,
01:36
while CSS is used to determine the manner in which that content is displayed and can apply its changes to everything it needs to simultaneously.
01:46
Think of yourself as a billionaire looking at your house and saying, no, I want it all Victorian.
01:52
Well, the billionaire doesn't then go antiquing for silverware and learn how to oil paint.
01:59
They just pay someone to do it all for them.
02:02
Well, CSS is the someone you hire to do it all for you.
02:07
You can change a single line of code and the CSS will automatically affect every object defined by that line of code,
02:14
making it very easy to deploy massive stylistic changes, update logos, et cetera, with just a couple of keystrokes.
02:22
So what is a cascading style sheet essentially?
02:26
It's just a text document, except it has a special kind of magic because it ends in CSS instead of txt.
02:34
If you wanna create one from scratch, you could start by creating a new text document and then immediately resave your file and change its extension.
02:46
We're gonna call it style css, and yes, every CSS in Q-SYS must be named style CSS because Q-SYS is also your cat and it's picky.
02:57
You'll notice the windows now identifies it as a CSS file rather than a text document.
03:03
So let's delete that first text document and just use our CSS file now.
03:07
Most importantly, this file has to be placed in the Styles folder wherever Q-SYS stores its assets by default.
03:14
This is in your documents folder under Q-SYS Designer slash Styles, but you can customize this under file preferences General asset directory.
03:24
So be sure to use this to find the correct location of your styles folder.
03:29
Inside that styles folder, create a new folder named for your CSS theme and place your file there.
03:35
This folder name is how it will appear inside Q-SYS.
03:40
Next, you can start writing your file.
03:43
Most professionals will use a code editing software, but let's just do this in good old notepad to keep it real simple.
03:50
Let's write one line.
03:52
Button background blue.
03:56
The coding here is very simple.
03:58
Name of the object you want to target.
04:01
Open some braces.
04:02
You know those squiggly brackets, name of the attribute you wanna change and the parameter to change it to.
04:09
That's it.
04:10
You've just told Q-SYS to make every button blue.
04:13
Congratulations, you're a graphic designer now.
04:16
Now let's get it into Q-SYS first.
04:19
Create a quick UCI to test it on and add a button so that we can see this in action.
04:26
Next, go to tools.
04:29
Show design resources.
04:31
Here you'll see the names of all the available CSS options in your styles folder.
04:37
Click on install style and it will embed that CSS into your Q-SYS file.
04:43
You can click on the installed tab to check which ones you've added.
04:47
Larger CSS files may end up having lots of images, which is why we only want to install the CSS files we're gonna use to avoid accidentally making a cutest file that's 900 megabytes.
04:58
Uh, once it's installed, it's not applied automatically because.
05:03
Chaos.
05:04
You may have multiple UCIs and multiple CSS you want to apply to them.
05:09
Q-SYS is not your child and therefore does not control you.
05:12
So you have to select your UCI in the left hand pane and then find its style property in the right hand pane.
05:20
Voila, a blue button.
05:22
Now let's go back and change the CSS file.
05:25
Let's say I wanna change this from blue to purple.
05:29
As soon as I save my CSS file, you'll notice the Q-SYS prompts if you want to update it as well, which is kind of, it's saying, Hey, I noticed you've been tinkering with my code.
05:40
Remember, you're editing a text document on your pc, which is different than the version you baked into