How can I convert a SASS file to a CSS file in an ANT task?


Tags: css,ant,sass

Problem :

How can I convert a SASS file to a CSS file in an ANT task? I want to use SASS with my java web application.



Solution :

The command to convert Sass to CSS is:

sass input.sass output.css

I'm not very familiar with Ant, but this works for me. This will compile the *.sass files in sass-dir and output the CSS files to css-dir.

<target name="sass">
  <property name="css-dest" location="css-dir"/>
  <delete dir="${css-dest}"/>
  <mkdir dir="${css-dest}"/>
  <apply executable="sass" dest="${css-dest}">
    <srcfile/>
    <targetfile/>
    <fileset dir="sass-dir" includes="*.sass"/>
    <mapper type="glob" from="*.sass" to="*.css"/>
  </apply>
</target>

    CSS Howto..

    How to add multiple css rules to minimize browser reflows?

    How to make a floated div 100% height of its parent?

    How Do I Trigger My jQuery Event?

    How to change the color of table rows once ng-repeat executed

    How to move elements inside the left column of a 2 column css grid above and below the main content area on collapse

    How to make a barlike chart but only with html and css [closed]

    How to Convert SASS on the fly to CSS in Python?

    How to pull css properties along with html content in Ajax?

    How to get CSS to E-Mails back in Magento 1.9.1

    How can I make my numbered scale responsive to scrolling and clicking?

    How to do proper and responsive Image Grid view with display:flex [duplicate]

    Buttons on bootstrap timepicker is not showing

    How to apply CSS color on parent element using a color picker?

    how to turn off the break word in css? [duplicate]

    How to fill in blank space using html and css

    How to make an html section right justified and shift to a new row if the window is narrow?

    how to change css property of 2nd & 6rd DIV using jquery

    How to adjust the top of an image and an input in the same line?

    jquery-ui icons not showing in production environment

    CSS Transition not showing with directive

    How to know values of all attributes and properties of a tag element in HTML

    How can I scale element height and width using CSS?

    How to make a navbar appear in certain section of the page? (bootstrap too)

    how to get a CSSStyleSheet object from a