tgoop.com/codingWithElias/427
Last Update:
4. Functions
In this example, we define a function called calculate-width. This function takes three parameters: $container-width, $columns, and $gutter. It calculates the width of each column based on the container width, number of columns, and gutter size, and returns the result.
We then define a .container class with a fixed width of 960px and centered horizontally using margin: 0 auto;.
We also define a .column class with a float: left; and a margin-right: 20px;. The width of each column is calculated using the calculate-width function, passing in the container width of 960px, 3 columns, and a gutter size of 20px.
By using functions, we can write more dynamic and reusable code. We can define complex calculations and reuse them throughout our styles, without having to repeat the same code over and over again. This also makes it easier to maintain our code and make changes to our styles in one place.
#SASS
@javascript_tut @codingWithElias
BY Coding with Elias

Share with your friend now:
tgoop.com/codingWithElias/427