Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hhanova authored and ujovlado committed Nov 7, 2024
1 parent 56ab19d commit 1a7f51a
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions components/data-apps/general-design-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,7 @@ Use the following code for primary buttons; secondary buttons can be simple `st.
{: .image-popup}
![Screenshot - Save Data](/components/data-apps/general-design-guide/pic3.png)

```
def ChangeButtonColour(widget_label, font_color, background_color, border_color):
htmlstr = f"""
<script>
var elements = window.parent.document.querySelectorAll('button');
for (var i = 0; i < elements.length; ++i) {{
if (elements[i].innerText == '{widget_label}') {{
elements[i].style.color ='{font_color}';
elements[i].style.background = '{background_color}';
elements[i].style.borderColor = '{border_color}';
}}
}}
</script>
"""
components.html(f"{htmlstr}", height=0, width=0)
```


**Example**
```
Expand Down

0 comments on commit 1a7f51a

Please sign in to comment.