"scss array" Code Answer's
You're definitely familiar with the best coding language CSS that developers use to develop their projects and they get all their queries like "scss array" answered properly. Developers are finding an appropriate answer about scss array related to the CSS coding language. By visiting this online portal developers get answers concerning CSS codes question like scss array. Enter your desired code related query in the search bar and get every piece of information about CSS code related question on scss array.
scss array
In Sass < 3.3 you can use multidimensional lists:
$numbers: (3 "three") (4 "four");
@each $i in $numbers {
.#{nth($i,2)}-#{nth($i,1)} {
/* CSS styles */
}
}
DEMO
In Sass >= 3.3 we get maps:
$numbers: ("3": "three", "4": "four");
@each $number, $i in $numbers {
.#{$i}-#{$number} {
/* CSS styles */
}
}
DEMO
So in terms of fractions, you could just do something in this direction, so that you don't need multiple lists or maps:
$number: 6;
$name: (
("one"),
("two" "halv" "halves"),
("three" "third" "thirds"),
("four" "quarter" "quarters"),
("five" "fifth" "fifths"),
("six" "sixth" "sixsths")
);
and then whatever you want to do with your loops ... maybe even something like this =D
@for $i from 1 to $number {
@for $j from 2 through $number {
.#{ nth( nth( $name, $i ), 1 ) }-#{
if( $i>1,
nth( nth( $name, $j ), 3 ),
nth( nth( $name, $j ), 2 )
)} {
/* CSS styles */
}
}
}
DEMO
(I wrote it this way so that you can notice in @for, that using to goes to n - 1)
All those coders who are working on the CSS based application and are stuck on scss array can get a collection of related answers to their query. Programmers need to enter their query on scss array related to CSS code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about scss array for the programmers working on CSS code while coding their module. Coders are also allowed to rectify already present answers of scss array while working on the CSS language code. Developers can add up suggestions if they deem fit any other answer relating to "scss array". Visit this developer's friendly online web community, CodeProZone, and get your queries like scss array resolved professionally and stay updated to the latest CSS updates.