Skip to content

Accessing Namespaced Variables and Attributes #564

Closed

Description

@alixaxel

Both the website documentation and this (http://coding.smashingmagazine.com/2010/12/06/using-the-less-css-preprocessor-for-smarter-style-sheets/) Smashing Magazine article state that LESS variables can be declared and accessed inside namespaces, however no matter what I try I can't recreate the 5th example of the SM post.

This would be so useful to me, for instance line-height: @size * body['line-height'] / body['font-size']; would allow me to speed up the vertical rhythm calculations in my LESS declarations - but I always get syntax errors. :-(

So, what is the status on this feature? Was it bogus? Will it be implemented? Or something else..?

Activity

  1. alixaxel commented on Jan 11, 2012

    @alixaxel
    Author

    Oh, no! #6

  2. cloudhead commented on Jan 11, 2012

    @cloudhead
    Member

    Yea, just store the value in a variable, then you can re-use it where you want.

  3. alixaxel commented on Jan 11, 2012

    @alixaxel
    Author

    @cloudhead: Yes, I'll have to resort to that - it would be nice to have accessors though, to reduce the variable pollution.

    I assume the lack of accessors affects both the attribute values and namespaced variables, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions