MarBar77 Posted March 9, 2018 Share Posted March 9, 2018 Hi, I want to ask how can I override parent CSS from component level. This is my case: 1) I have created new component based on TUniPanel for example I named it TMyUniPanel. 2) In TMyUniPanelk there are 2 panels inside 3) TMyUniPanel has for example white color, and two panels inside has for example black color. 4) I put this TMyUniPanel on unigui form without custom CSS stylization and it has those colors in runtime (and this is OK) 5) But in destination environment I have to put TMyUniPanel on TabSheet of TUniPageControl component and internal work area of TUniPageControl is stylized for example on yellow color, now in runtime all my Panels and TMyUniPanel have yellow color too. 6) So, I think to change class of my TMyUniPanel and I do that by adding component constructor ClientEvents.UniEvents.Add('aftercreate=function aftercreate(sender){sender.addCls(''onlPanel'');sender.addBodyCls(''onlPanel'');}'); but it doesn't help, panels are still yellow. Is there any possibility to force that child control (TMyUniPanel) does not have parent CSS stylization? I don't want to use customCSS for every TMyUniPanel, because I have component properties for settings control colors, and I want to change this colors from code in runtime. Marcin Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted March 10, 2018 Share Posted March 10, 2018 Can you provide a test program? Also can you share content of "onlPanel" css Quote Link to comment Share on other sites More sharing options...
MarBar77 Posted March 10, 2018 Author Share Posted March 10, 2018 Here is sample app with Panel inside PageControl and outside PageControl. Inside zip there is also source ot my Panel component. https://1drv.ms/u/s!AtP5BtucE5MeioQwJ01VQ0tLmI-Wdw Marcin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.