Results 1 to 3 of 3

Thread: using random() function is sass

  1. #1
    Sencha User
    Join Date
    Nov 2016
    Posts
    1

    Default using random() function is sass

    I'm using random() function in sass file but upon compilation I'm getting an error
    my code
    Code:
    $colors: #ffeb87, #c5b8fc, #ef94d8, #f6b5fc, #b371e2, #abe0fc, #fc99c6, #e96ff7, #a8acf7, #cffc76, #9bffb9, #e68ef2, #92f1f4, #ff77bd, #f785c9, #93ffa9, #c1f47a, #f47ac7, #e496f7, #f7786f, #b2e0ff, #81efec, #f47c8c, #c0d2f9, #d8c2fc, #92fcf5, #70b6e5, #8191f9, #76f7aa, #8dfc9a, #75ffe8, #f393f9, #98fc74, #f38dfc, #80fcb6, #e591ff, #d7f9a4, #ff837f, #fc9d7e, #eb89ff, #d5c2f9, #ffeac9, #b1f99f, #ff87e5, #ddc7fc, #96a7f2, #d2f9a2, #fcb5b6, #f780cb, #efd481;
    $repeat : 20;
    @for $i from 1 through $repeat {
      .random-number-#{$i}{
        background-color: nth($colors, random(length($colors)));
    }
    }
    error
    Code:
     Error: List index random(50) must be an integer for 'nth'

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    What is being returned if not an integer?

  3. #3
    Sencha User
    Join Date
    Apr 2013
    Posts
    914
    Answers
    105

    Default

    Does Sencha Fashion even have "random" function built-in?

Similar Threads

  1. List of sass function we can use
    By A. Llorente in forum Ext JS 6.x Q&A
    Replies: 2
    Last Post: 21 Mar 2016, 11:55 PM
  2. PhoneGap 1.7 - Application starts on random card of random panel?
    By stefankendall in forum Sencha Touch 2.x: Bugs
    Replies: 1
    Last Post: 5 Jun 2012, 4:21 AM
  3. [Beta5:SASS] Cannot found "parsebox"function
    By Kazuhiro Kotsutsumi in forum Ext: Discussion
    Replies: 2
    Last Post: 14 Jul 2011, 5:13 PM
  4. Replies: 1
    Last Post: 24 Feb 2011, 9:57 PM
  5. Random issue with big random numbers
    By bulforce in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 12 Oct 2009, 3:45 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •