{"action":"created","issue":{"url":"https://api.github.com/repos/less/less.js/issues/2758","labels_url":"https://api.github.com/repos/less/less.js/issues/2758/labels{/name}","comments_url":"https://api.github.com/repos/less/less.js/issues/2758/comments","events_url":"https://api.github.com/repos/less/less.js/issues/2758/events","html_url":"https://github.com/less/less.js/issues/2758","id":121890581,"number":2758,"title":"Option to dump all variables","user":{"login":"battlesnake","id":4949354,"avatar_url":"https://avatars.githubusercontent.com/u/4949354?v=3","gravatar_id":"","url":"https://api.github.com/users/battlesnake","html_url":"https://github.com/battlesnake","followers_url":"https://api.github.com/users/battlesnake/followers","following_url":"https://api.github.com/users/battlesnake/following{/other_user}","gists_url":"https://api.github.com/users/battlesnake/gists{/gist_id}","starred_url":"https://api.github.com/users/battlesnake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/battlesnake/subscriptions","organizations_url":"https://api.github.com/users/battlesnake/orgs","repos_url":"https://api.github.com/users/battlesnake/repos","events_url":"https://api.github.com/users/battlesnake/events{/privacy}","received_events_url":"https://api.github.com/users/battlesnake/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-13T01:05:51Z","updated_at":"2015-12-13T16:14:59Z","closed_at":null,"body":"A nice aspect of less is immutable variables - this would be even nicer if there was an option to have less simply evaluate all top-level variables and output them instead of generating CSS.\r\n\r\n*test.less*\r\n\r\n    @base: hsv(200, 65%, 85%);\r\n    @light: lighten(@base, 10%);\r\n    @dark: darken(@base, 30%);\r\n    @darker: darken(@base, 60%);\r\n    \r\n    /* Selectors and other CSS-generating stuff */\r\n    /* ... */\r\n\r\n*shell:*\r\n\r\n    lessc --dump-vars test.less\r\n\r\n*output:*\r\n\r\n    base: #4caad9;\r\n    light: #76bee2;\r\n    dark: #195573;\r\n    darker: #000000;\r\n\r\nCurrently, it seems that this can only be done by adding an \"echo\" selector:\r\n\r\n    dump {\r\n      base: @base;\r\n      light: @light;\r\n      dark: @dark;\r\n      darker: @darker;\r\n    }\r\n\r\nAnd this will be stuck in the rest of the generated CSS.\r\n\r\nLooking ahead, an optional parameter to specify the output format may also be a nice addition:\r\n\r\n    lessc in.less --dump-vars=json\r\n\r\nor\r\n\r\n    lessc in.less --dump-vars=keyvalue\r\n\r\n\r\nIn addition to aiding debugging, it would allow the extensive colour functions of less to be used to generate values for other programs to use."},"comment":{"url":"https://api.github.com/repos/less/less.js/issues/comments/164271481","html_url":"https://github.com/less/less.js/issues/2758#issuecomment-164271481","issue_url":"https://api.github.com/repos/less/less.js/issues/2758","id":164271481,"user":{"login":"seven-phases-max","id":5304376,"avatar_url":"https://avatars.githubusercontent.com/u/5304376?v=3","gravatar_id":"","url":"https://api.github.com/users/seven-phases-max","html_url":"https://github.com/seven-phases-max","followers_url":"https://api.github.com/users/seven-phases-max/followers","following_url":"https://api.github.com/users/seven-phases-max/following{/other_user}","gists_url":"https://api.github.com/users/seven-phases-max/gists{/gist_id}","starred_url":"https://api.github.com/users/seven-phases-max/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seven-phases-max/subscriptions","organizations_url":"https://api.github.com/users/seven-phases-max/orgs","repos_url":"https://api.github.com/users/seven-phases-max/repos","events_url":"https://api.github.com/users/seven-phases-max/events{/privacy}","received_events_url":"https://api.github.com/users/seven-phases-max/received_events","type":"User","site_admin":false},"created_at":"2015-12-13T16:14:59Z","updated_at":"2015-12-13T16:14:59Z","body":"See #2597.\r\n\r\n>In addition to aiding debugging, it would allow the extensive colour functions of less to be used to generate values for other programs to use.\r\n\r\nThat's weird. Instead of using Less code -> Less parser -> Less objects -> JavaScript functions -> Less objects -> Less output generator -> JavaScript data, one should really just have a descent JS color manipulation library."}}