Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure form styles override global styles #98

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 */
}
Loading