less / less/less.js

How to create a LESS variable with a Plugin

Open
#3,659 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question support as plugin
Dominant language
JavaScript
Stars
17k
Forks
3.4k
Avg merge
7h 42m
Merged PRs (30d)
26

Description

I want to create a simple LESS plugin that create variables on a function call

I want to do this because i want to have a less variable dynamic on runtime (link of unanswered question on why i want to do that)

In short

i want to do this :

less to css var

without having to do :

enter image description here

And just declare each variable once like :

enter image description here

And var() is the custom LESS plugin function i wanna make

What i tried

I tried to learn how to create plugin on lesscss.org, github.com, and on diverse site, but it's either just not enough, or really obscure on how to create variables

I also saw this blog post where he creates variables, but i tried every thing, and nothing worked

Finally

I just want some advices or code, and ideally an explanation on how tf it works

Thanks :)

Contributor guide

Open the contributing guide

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

The issue does not name a repository file, test, or implementation entry point. Start by reproducing the desired LESS input and output from the linked examples, then read the plugin and variable documentation in lesscss.org and the less/less.js repository; done would require a defined plugin approach and an accompanying example or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.