-
- 573 Posts
Just wondering if anyone can share how they incorporate sass with modx project. Currently I just edit the css in a static resource, but will like to take advantage of variables, shorter syntax etc of sass.
[ed. note: g5604 last edited this post 10 years, 2 months ago.]
-
- 1,145 Posts
Ooh, the names tortured me in the beginning: Sass, Scass, Compass, Sussy, Jane, Bingo, Haml, Ruby, Dime...
I pooh-poohed sass and haml for the longest until it dawned on me that it is actually pointless to do the grunt work while your computer has a price tag going off the roof. The Computer is your slave, use it as such! It is important to know how to do the grunt work though, because Sass and the others could disappear tomorrow; if that happens I'd just go back to my perfectly ordered .css file that Sass did for me before it vanished.
I don't let the server process my sass, everything is local for me, just as before. I think there is even a MODx extra that can process Sass. But I don't care for unnecessary dependencies.
Within SublimeText2, I have created a build system that activates ruby sass gem which validates and combines my little pieces of sass files. It also minifies the final output, Styles.css.
Since I end up using only one .css file for all screen modes (I don't mind that at all) I have:
_base.sass //has all my reusable variables, it is imported by all the other sass files. It includes Sussy and Compass.
+ desktop.scss // for the 700px+ screen
+ mobile.scss // for the smaller screen
+ styles.scss //this fellow includes/imports all the above files, it is the main file
I am terribly happy with my setup.
If I alter, say _base.scss or Sass file in that directory, and hit Ctrl+S, SublimeText knows to rebuild Styles.scss, and output Styles.css.
I have Styles.css always open, and so I just right click on its tab, and 'upload to server' ...and bingo!
I never have to see my site's css again, only the sweet strict logic of Sass with all its nesting, vendor prefixes and what not.
Of course during development, I turn off minify, so I can the better play with Chrome's Inspect Element.
If I have had a drunken stupor of imagination, and my sass/css lines are less than beautiful in structure, I hit SassBeautify in SublimeText.
Sussy for layout fluidity is pretty, and Compass, a life saver!.
So I say, go Sass!
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
-
- 24,544 Posts
-
- 573 Posts
Just a follow up to this. Here my first attempt at a new modx workflow (using modx cloud instead of local)
1) Write css in normal text editor (textWrangler)
2) Scout does the conversion from sass to minified css
3) Transmit is used to mount the site as a drive, which is then set as the output destination in scout
4) Livereload is used to refresh the live site site on save
The end result is I can write sass in my normal text editor, hit save and the site is automatically updated in the browser window. Huzzah!
-
- 573 Posts
Just realised scout can not work the same way for javascript. Can anyone recommend a different app that could combine and minify JS as well as sass?