Forum Discussion

aswani_kintali's avatar
10 years ago

Overriding a Component

If we override a component with @override , and include component in our page, iwill it use overridden component by default or should we include ovverriden component explicitly?

 

Example:

I m overriding abc component , abc@override. In page should I include abc or abc@override?

<@component id="abc"/> , will it work?

7 Replies

  • hpandey's avatar
    hpandey
    Ace
    6 years ago

    But look and feel i.e. CSS would be same as OOTB. How to override that?

  • PerBonomi's avatar
    PerBonomi
    Boss
    6 years ago

    Add your own css either in Stage's style section, or even inline, in the component itself.

     

    Also wanted to mention that if you override a component you can add <@delegate/> in the code. This will leave the oob component in tact and add whatever code you want below it. I use this,for example, to add options to menus.

  • hpandey's avatar
    hpandey
    Ace
    6 years ago

    Thanks for your reply. I understand your point. But the problem, I am facing to include SCSS code into component code. It breaks at some point, so rendering is not proper. Any Idea on that?

  • PerBonomi's avatar
    PerBonomi
    Boss
    6 years ago

    if it needs to be scss then you'll have to stick to using stage and adding a lot of !important.

    I only use regular css when I do it inline.