Modal Close Styling
How to style the close button for modal windows
The default style of the modal close or delete notification button is not very visible. We improve its readability by overwriting some of the Knack CSS with our own.
The JS
None needed 😎
The CSS
The delete
applies to both buttons whereas the close-modal
only applies to modal windows. The before
and after
are the two sticks that make the X. You will notice use !important
for every element. Since Knack already defines these stylings, we need to be able to overwrite them with our own.
How to Implement
If the theme of your application has a different color set, you may want to adjust the colors for the border, background color, or the X color. Otherwise, copy pasta and you are set 👍
Last updated