Sass for just HTML

I found SASS and it sounded great that you can use variables, make the code clean, etc .... But I see this for Ruby on Rails.

Is there a way to make it work with HTML as if it were CSS? If this is not possible, is there something similar?

Thanks!

(By the way, I will use php)

+4
source share
4 answers

You can use SASS anywhere, provided that you have installed ruby. It doesn't have to be a Ruby on Rails project, you just need to install the SASS gem.

See - http://sass-lang.com/tutorial.html

Alternatively, there are other CSS preprocessors, such as LESS and Stylus, which are compiled using node.js rather than ruby.

LESS - http://lesscss.org/

Stylus - http://learnboost.github.com/stylus/

Each of them provides similar functionality, but has slightly different syntax.

+5
source

Jade is the name of the preprocessor you are looking for.

Css-tricks mentions and shows this in this video tutorial on typing.
edit: view comments :)

+2
source

You can use sass with anything actually using sass binary. The following will look at the folder. / css / sass for changes and put the compiled .css files in. / css

sass --watch css/sass:css 
+2
source

Haml and Sass were used in Ruby to simplify templates (Haml) and make CSS more intelligent, flexible, and manageable (Sass); now they come in phaml php .

  • Regardless of the structure. PHamlP can be used with any structure (integration with wireframes requires wrapper functions; an example for Yii is provided - I would welcome contributions for other frameworks) or stand-alone.

  • Automatic indentation. PHamlP allows you to use spaces or a tab as indentation and automatically determines which of the files is the base; and if there are spaces, how many.

  • Rendering options for readability for development and a minimized production gap.

  • Support for Haml and Sass V3.x (support for SASS and .scss SASS syntax, FireSass integration, new variable syntax, @extend directive)

  • Includes compass (PHamlP V3.2 and higher).

+2
source

Source: https://habr.com/ru/post/1432818/


All Articles