Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7937559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:33:06+00:00 2026-06-03T22:33:06+00:00

I was wondering if anyone had ever attempted to create a less or sass

  • 0

I was wondering if anyone had ever attempted to create a less or sass stylesheet that had parameters that could be extended via code.

For instance:

@primary-color: red
@secondary-color: grey

The less file is set up to use the inputs (think wordpress file with 2-5 color options in the editor) and then the css and classes could all be modified by those limited choices.

I typically see solutions which create inline code throughout the whole page, but it would appear to make more sense to create master less/sass pages that could be modified via a couple inputs that could appear in a small script file in the head of the page.

This type of solution would appear to make a great deal of sense when theming a design.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:33:07+00:00Added an answer on June 3, 2026 at 10:33 pm

    I had to implement something like you’re describing in a recent project and I ended up using lessphp. Basically, the method I used was:

    1. Read a LESS sheet from a file.
    2. Prepend some custom LESS to the beginning of the string you have in memory, like variable declarations or whatever.
    3. Pass the full LESS string to the lessphp parser, get the CSS.
    4. (Optional) Cache the result intelligently to save yourself some processing time in the future.
    5. Serve the CSS.

    A method like this could easily be used in a WordPress theme to offer customization.

    Additionally: One thing that I botched in my implementation that I’d try to avoid in the future is keeping the variable style separate from the rest of the stylesheet. That is, the lessphp-generated file should only contain styles that depend on your dynamic variables and should only live to augment styles that are in an existing static sheet (with defaults as colors/options). This saves processing power and also lets you use less.js to write the majority of your styles, giving you the ability to use #!watch, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if anyone had or could point me in the direction of
I was wondering if anyone had any advice on the best way to create
I was wondering if anyone had some resources that describe the binary protocol used
I was wondering if anyone had any suggestions on improving the following code (if
I was wondering if anyone had ever implemented multiple Django webservers pointing to a
I was wondering if anyone had experience they could share using the Response.IsClientConnected property
Was wondering if anyone had any smart approaches to creating dynamic vanity user urls
I was wondering if anyone had developed an approach for using NHibernate / Fluent
I was wondering if anyone had an opinion on what they think is the
I was wondering if anyone had any advice on parsing a file with fixed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.