Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User guide: give examples for adding custom classes to elements #371

Closed
damithc opened this issue Jul 25, 2018 · 3 comments
Closed

User guide: give examples for adding custom classes to elements #371

damithc opened this issue Jul 25, 2018 · 3 comments

Comments

@damithc
Copy link
Contributor

damithc commented Jul 25, 2018

v1.9.2

Perhaps in the advanced tips section we can give detailed examples of how to use custom classes? These are the things I want to do in particular:

  • Hide certain elements in a page
  • Panels
    • hide border, increase thickness of border
    • set a background color for the panel header (different from the bootstrap colors)
  • hide modals, tooltips (not possible?)
@damithc
Copy link
Contributor Author

damithc commented Jul 26, 2018

@Chng-Zhi-Xuan can give me example code fir the first item? Would like to try it out tomorrow.

@Chng-Zhi-Xuan
Copy link
Contributor

Chng-Zhi-Xuan commented Jul 26, 2018

With the help of Bootstrap utility classes

Note: I realised some components toggle the display class on their outermost element, so it might not permanently hide the component after a event trigger. (Modals is one example if I remember correctly)

1. Permenantly hide

<panel header="..." add-class="d-none">
   <p>Contents inside will be hidden too</p>
<panel>

2. CSS controlled hide

<panel header="..." add-class="ninja-turtle">
   <p>random text</p>
</panel>

Then in a page specific CSS (inserted via the head content feature)

/* your custom CSS file */
.ninja-turtle {
  display: none; /* 'block' or 'inline-block' if you want it to show */
}

This implementation allows you to use <include> and the elements will adapt to the destination's page CSS.

You can use the ninja-turtle class on normal HTML elements too, to hide / show them. However, since there is no eventListener to update the classes, it will be hidden (or shown) permanently, depending on your display: value.

@damithc
Copy link
Contributor Author

damithc commented Jul 26, 2018

Thanks. Did a small trial. Managed to hide a panel 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants