"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

By SantinoSantino on Mar 09, 2021
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)

Add Comment

0

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. 

CSS answers related to "scss array"

View All CSS queries

CSS queries related to "scss array"

scss array bootstrap 4 scss angular 8 bootstrap scss bootstrap-scss github loop scss scss transition random color scss media query in scss scss sass watch command line variables scss en calc() scss how to use a variable in entire angular project loops scss ERROR in ./resources/sass/app.scss Module build failed (from ./node_modules/css-loader/index.js): var minus scss scss react convert angular project from css to scss watch scss to css scss hover change css to scss angular sass vs scss scss extend scss import font from google setup scss in vue scss ::after scss media query media queries scss watch scss scss second div child npm scss scss gradient mixin scss darken importing scss into vue component how to compile scss to css scss watch command variables scss how to use scss in html scss maps´ scss @mixin base what is scss hover button scss scss how to use map Nuxt scss scss comment simple font-face mixin scss scss link style scss npm import SCSS lighten comentarios en archivo scss css sass scss media screen scss mixin how to make a scss variable scss multiple classes scss classes scss linear gradient not working scss loop scss global class scss file structure css vs scss scss what is scss @content dynamic classes scss angular scss doesn't work backgorund scss mixin skip argument use default installer scss projet wordpress Mergeable selector SCSS-lint Solved how to use class form scss reactjs bind 'fill' inside ':svg:path' with scss variables extend scss scss conditional style import global variables scss angular undefined variable scss scss transition mixin all heading tags selector scss how to save scss file compile scss vue scoped scss media query scss variables mixins scss vs code SCSS variables scss javavscript use .filter to return odd numbers in an array How to add object in an array using useState mysqli load result into array filter array by keyword difference between numpy array and matrix flask sqlalchemy array column bash access array indirectly add object to array setstate use .map to count length of each element in an array typescript count array condition

Browse Other Code Languages

CodeProZone