Comments (3)
I would do this with CSS:
.user-profile:hover {
.user-details > .name,
.user-image > .image {
// ...
}
}
Edit: I adjusted the code a little bit, I forgot you mentioned that the styles would be applied to both elements.
from rscss.
Unfortunately this is one of the edge cases that RSCSS falls short of. .user- details { .user-profile:hover & { .. } }
(or the variant James mentioned)
seems like a pretty good workaround.![](https://link.nylas.com/open/45iu4p1xsz
s6wds5wnj30hzg1/local-54369243-aff4?r=cmVwbHkrMDAwMTIyOTE2MzZlOTFlY2RiMGQ0MjA0
MzYwYzA2MDgzYjcwZWExYjliMGNmOTBhOTJjZjAwMDAwMDAxMTNjMDcxZjQ5MmExNjljZTBhMjExOD
M1QHJlcGx5LmdpdGh1Yi5jb20=)
On Aug 9 2016, at 12:14 am, James Kolce [email protected] wrote:
I would do this with CSS:
.user-profile:hover {
.user-details > .name {
// ...
}.user-image > .image { // ... }
}
I think that's the minimum amount of code you can use without falling into
ambiguities.You are receiving this because you are subscribed to this thread.
Reply to this email directly, [view it on GitHub](https://github.com/rstacruz/
rscss/issues/49#issuecomment-238287876&r=cmVwbHkrMDAwMTIyOTE2MzZlOTFlY2RiMGQ0M
jA0MzYwYzA2MDgzYjcwZWExYjliMGNmOTBhOTJjZjAwMDAwMDAxMTNjMDcxZjQ5MmExNjljZTBhMjE
xODM1QHJlcGx5LmdpdGh1Yi5jb20=), or [mute the
thread](https://github.com/notifications/unsubscribe-auth/AAEikZ3XSTyVQ0EzEQPI
_qEJHqzo_Yr_ks5qd1X0gaJpZM4JfHjq&r=cmVwbHkrMDAwMTIyOTE2MzZlOTFlY2RiMGQ0MjA0MzY
wYzA2MDgzYjcwZWExYjliMGNmOTBhOTJjZjAwMDAwMDAxMTNjMDcxZjQ5MmExNjljZTBhMjExODM1Q
HJlcGx5LmdpdGh1Yi5jb20=).![](https://github.com/notifications/beacon
/AAEikVLvKLBBdUAY2jyHc3iKqK-9GA6vks5qd1X0gaJpZM4JfHjq.gif)
from rscss.
Thanks for your replies!
Rico, I think you're right. It actually is rather an edge case but it's quite an interesting though. I spent some time thinking about it and what do you guys think about that:
Maybe you could see it as something like a variant – strictly seen it actually is – but only for interactive states or as a kind of glue. Right now I'm abusing the component pattern just for having a class/identifier to style other nested components. Maybe this could also be something that could reside in the helpers section?
Something like ._hover & > .name { }
? Since I don't actually care what's the name of the glue that is connecting the nested components it could be just another helper class. But there might be another edge case where this could cause conflicts if you are in a nesting hell.
Nevertheless this is something that shouldn't occur on purpose and should actually be avoided if you stick to RCSS and think twice about your components!
Doesn't it?
from rscss.
Related Issues (20)
- Integration of Bootstrap // custom Themes // JS Plugins HOT 4
- RSCSS example sites HOT 8
- CSS Structure: About glob matching for Less HOT 2
- About FIle Structure HOT 1
- Propose a file structure HOT 6
- Projects that have used RSCSS HOT 1
- Translation to spanish HOT 5
- Nested components and fallback fonts for web fonts HOT 1
- Protuguese Translation HOT 1
- Suggestion for naming with multiple words to camelCase HOT 2
- How can I style deeply nested HTML elements using RSCSS? HOT 8
- AMCSS
- Class for namespace?
- How to handle nesting with grid css HOT 1
- Project state
- Extending variant depreciation HOT 1
- PR for clarify variant naming HOT 2
- Is it typo on nested-components.md?
- Create wiki HOT 3
- rscss.io offline HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rscss.