1. #1
    Ext JS Premium Member
    Join Date
    Nov 2010
    Posts
    10
    Vote Rating
    0
    user56279 is on a distinguished road

      0  

    Default Quick SASS question re: mixin arguments

    Quick SASS question re: mixin arguments


    I didn't see this addressed in any SASS documentation, so I'll try here.

    If you have multiple arguments, is there a way to pass only an argument later than the first without passing the first?

    In javascript you could use empty quotes to indicate that you want to skip that argument, but that doesn't appear to work with SASS. e.g., myFunction('','',500);

    What do you do in SASS to indicate empty arguments?

    Thanks.

  2. #2
    Ext JS Premium Member
    Join Date
    Nov 2010
    Posts
    10
    Vote Rating
    0
    user56279 is on a distinguished road

      0  

    Default Can't be done...yet.

    Can't be done...yet.


    Can't be done...yet.

    "In Sass 3, there's no way to use the default values for the first arguments to a mixin and a non-default value for later arguments. Sass 3.1, currently in development, supports passing arguments by name, but in 3.0 the best way to do this is just to manually pass in the default values."

    - Nathan Weizenbaum

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    9
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    If you do the following:

    sudo gem install sass --pre
    sudo gem install compass --pre
    sudo gem install haml --pre

    You can actually do named arguments. We have started to use this a little inside the Ext 4 theme. This is one of the reasons you need the bleeding edge versions of all the gems to be able to compile to Ext 4 theme. You can use named arguments like this:

    @include x-frame($border-radius: 10px, $background-gradient: 'matte');

    For the rest it would use all the default values.

  4. #4
    Ext JS Premium Member
    Join Date
    Nov 2010
    Posts
    10
    Vote Rating
    0
    user56279 is on a distinguished road

      0  

    Default


    Nice.

    Thanks for the info, Tommy.

    I've only been exploring SASS for a couple days now. It's funny that it doesn't naturally support the very first thing I wanted it to do. It seemed like an obvious thing to do when you have the option to specify default values. It kind of defeats the purpose of using arguments if you need to pass back the default values to get at an argument later in the list.

Similar Threads

  1. quick question
    By alex1001 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 17 Mar 2010, 5:27 PM
  2. A quick question about documentation please
    By Litre in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 26 Jan 2010, 11:57 AM
  3. Quick forum question
    By azuroff in forum Community Discussion
    Replies: 1
    Last Post: 15 Dec 2009, 5:45 PM
  4. 1.0 to 2.0 quick question
    By Mthor in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 18 Apr 2008, 11:02 AM
  5. Quick Question
    By putty in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 31 Mar 2008, 5:15 PM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar