The best solution nowadays to make a button use the primary color of the app as its fill color is to set type="primary"
:
st.button("My button", type="primary")
If you need more button customizations beyond that, please see the CSS tricks below or let us know on this GitHub issue.
(I know this thread is quite old but since it’s still getting a lot of views + we have a non-hacky solution for the original problem, I thought it’s worth updating ).