• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Make css class "private"

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

For example you are independent developer who created a custom component "BaseComponent" that contains only AnchorPane with an empty css class "external".


I'm another developer who created my custom component "SuperComponent", that contains  2 BaseComponent's "One" , "Two", with classes "background" , and "foreground". A SuperComponent.css style class looks like:
 

And as you can see , i used a "background" class name, that's very common.

A third employee inserts SuperComponent to his big project. And he has already defined css class



Because SuperComponent has only empty class "background" it applies a red background to it, that wasn't expected to.
So how can i encapsulate SuperComponent .background class of being overriten outside?

1)
I'v tried to add another class for each component "One" and "Two", and make css like :
 

That not helped. A third employee css

overrides it again.


2)
I'v tried to set a root class of my SuperComponent and make css like:  


or



Also not helped.

I'v found only 2 ways of doing that, non of them i liked:
1) Rename my background class to  "supercomponent-background", but this is nonsense, because for my point i'm already in supercomponent.css and operating my "unique" .background class
2) Override all properties for .background class. This is also meaningless, because i need to overrite EVERY -fx-property.

Please explain how to properly get out of the situation.



 
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!