less / less/less-meta

use cases for having both modify-vars and global-vars

Open
#6 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
5
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I understand modify-vars and global-vars are different, but what are use case for using global instead of modify, on first sight having both seems in contrast with http://lesscss.org/features/#variables-feature-default-variables.

Why should you define a global if you overrule it in the file? Possible use cases are compiling more than one file with the same settings?

For in browser usage the above case now can be solve easily by using data attributes:

<link type="text/css" href="t.less" data-global-vars='{ "color": "red"}' rel="stylesheet/less">
<link type="text/css" href="t2.less" data-modify-vars='{ "color": "green"}' rel="stylesheet/less">

Also task runners can compile a list list of files, but also that cases can possible solved by defining more than one or conditional task, instead of defining defaults (globals).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the Less variables feature documentation linked in the issue, focusing on the distinction between modify-vars and global-vars. Determine whether concrete use cases, such as compiling multiple files or browser data attributes, should be documented; done means the rationale and distinction are explained clearly.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.