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

  • SEARCH
  • Home
  • 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 8977631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:24:56+00:00 2026-06-15T19:24:56+00:00

I would like to have a property reference its self, I am not sure

  • 0

I would like to have a property reference its “self”, I am not sure how to do this in LESS. Heck I am having a hard time crafting the wording of the question. Basically I would like to accomplish the following:

a:visited {
    color: lighten(color, 10%);
}

Where a‘s color could vary based on its container div.

So I might have the following selectors:

div#blue-text a {
    color: #00F;
}

div#black-text a {
    color: #000;
}

Once I visit the links, I should have a lighter blue and gray link texts respectively.

Note: this is a very simple scenario, but I have much more complicated needs, and if there is a clean way to do this, then I would be a happy camper.

  • 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-15T19:24:57+00:00Added an answer on June 15, 2026 at 7:24 pm

    Basically, since you’re going to set the parent’s color in LESS as well, you would store the color in a variable and reference it.

    Here is an example:

    @column1Color: #aaaaaa;
    @column2Color: #bbbbbb;
    @column3Color: #cccccc;
    
    .columns {
        // set the color of the first column
        .column:nth-child(1) {
            background-color: @column1Color;
            a {
                color: lighten(@column1Color, 10%);
            }
        }
        // set the color of the second column
        .column:nth-child(2) {
            background-color: @column2Color;
            a {
                color: lighten(@column2Color, 10%);
            }
        }
        // set the color of the third column
        .column:nth-child(3) {
            background-color: @column3Color;
            a {
                color: lighten(@column3Color, 10%);
            }
        }
    }
    

    LESS would not know what the color of the hyperlink is unless you “told” it. Same goes for the browser, it would not know the color unless it executes all the linked CSS files.

    So, what you need (if I understood you correctly) can not be achieved the way you’re thinking about it.

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

Sidebar

Related Questions

I have this array property in my model and would like to see it
I would like to have a private property in a class, and be able
I'm using Java Property files and would like to have a newline character put
I have a string property that I would like to be able to force
I would like to change the entity property from String to long. I have
I have a Silverlight ModelViewViewModel project that I would like to expose a property
I have a datetime.datetime property var. I would like to know if it is
I would like to have an AppWidget that designed like this one . Image:
I have a NSMutableArray property in my AppDelegate called blocks. I would like to
Main Question: I have a reference type (object/class) where I would like to specify

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.