Skip to content

Commit

Permalink
fix: ensure form styles override global styles
Browse files Browse the repository at this point in the history
Specificity was too low on certain definitions, resulting in styles being overridden by user styles.
  • Loading branch information
chrisvxd committed Sep 21, 2023
1 parent 05ddca3 commit 104091a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/core/components/InputOrGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const InputOrGroup = ({
</IconButton>
</div>
</summary>
<fieldset>
<fieldset className={getClassName("fieldset")}>
{Object.keys(field.arrayFields!).map((fieldName) => {
const subField = field.arrayFields![fieldName];

Expand Down Expand Up @@ -231,6 +231,7 @@ export const InputOrGroup = ({
>
<input
type="radio"
className={getClassName("radioInput")}
value={option.value as string | number}
name={name}
onChange={(e) => {
Expand Down
17 changes: 11 additions & 6 deletions packages/core/components/InputOrGroup/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
display: none;
}

.Input-arrayItem > fieldset {
.Input-arrayItem > .Input-fieldset {
background-color: var(--puck-color-grey-11);
border: none;
border-top: 1px solid var(--puck-color-grey-8);
Expand All @@ -101,11 +101,16 @@
padding-top: 16px;
}

.Input-arrayItem > fieldset .Input + .Input-arrayItem > fieldset .Input {
.Input-arrayItem
> .Input-fieldset
.Input
+ .Input-arrayItem
> .Input-fieldset
.Input {
margin-top: 16px;
}

.Input-arrayItem > fieldset .Input-label {
.Input-arrayItem > .Input-fieldset .Input-label {
padding-bottom: 4px;
}

Expand Down Expand Up @@ -178,16 +183,16 @@
cursor: pointer;
}

.Input-radio input:checked ~ .Input-radioInner {
.Input-radio .Input-radioInput:checked ~ .Input-radioInner {
background-color: var(--puck-color-azure-9);
color: var(--puck-color-grey-2);
font-weight: 500;
}

.Input-radio input {
.Input-radio .Input-radioInput {
display: none;
}

.Input textarea {
.Input textarea.Input-input {
margin-bottom: -4px; /* Remove strange bottom border */
}

0 comments on commit 104091a

Please sign in to comment.