You can target any component using CSS attribute selectors (an attribute and attribute value wrapped in square brackets) and substring matching.
Using an id
attribute selector let's us target the substring value of what you named that component / your component ID. All we have to do is:
- Name our component with a unique name relative to its purpose. For this example, let's just call it
myCustomSizeModal
. This is the value of our component ID. - We then use substring matching on our attribute selector by following it with the asterisk symbol
*
, which will target any attribute value withmyCustomSizeModal
somewhere within its value string. - We then target our id attribute with attribute selector syntax. In this case, it would look like this:
[id*="myCustomSizeModal"] {
width: 200px !important; /* ...use !important to override default width... */
height: 200px !important; /* ...use !important to override default height... */
}
- This would change the width and height of the modal to 200px × 200px.