[feature suggestion] Copy property value from a given selector
See original GitHub issueI was thinking that it would be great if we had a way of copying values from other properties by passing a selector. Here’s how I can imagine this being used:
.icon {
content: "";
display: inline-block;
width: 16px;
height: 18px;
// Since the value is the same, we can just reference it.
line-height: &.height;
}
// Referencing body values.
.my-content {
background: body.background;
color: body.color;
}
Or maybe having something like @value
, IDK.
I know this can be accomplished by using variables but it could be useful anyway.
Issue Analytics
- State:
- Created 10 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Compatible property types for copying values with workflows
There are two types of date properties in HubSpot: date picker properties and datetime properties. You can copy values between both types.
Read more >c# - Apply properties values from one object to another of the ...
This short and simple Extension method will allow you to copy matching properties from one object to another with the check of Null...
Read more >To Copy Properties From One Object to Other Objects
Click Home tab > Properties panel > Match Properties. Find; Select the object from which you want to copy properties.
Read more >CSS selectors - Learn web development | MDN
It is a pattern of elements and other terms that tell the browser which HTML elements should be selected to have the CSS...
Read more >Using $select, $expand, and $value in ASP.NET Web API 2 ...
The following request gets a property in OData format. Console Copy. GET http://localhost/odata/ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SamHH #109 is still open, you can try adding your suggestion there.
@nex3 Closed and old issue I know, but I can’t find an open and relevant issue for this. Here’s an example of where Stylus bests Sass because of property lookup:
Sass:
Stylus:
It’s not a big deal but I think it helps a lot with readability. Whereas with a var you can’t immediately visually grep how often a var is used (and what the consequences are of changing it), you can immediately tell with a property lookup that there is a direct connection between two properties that doesn’t affect anything else.