Skip to content

chore:n8nForm Node add css variable for media-size>500px #15771

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
15 changes: 9 additions & 6 deletions packages/cli/templates/form-trigger.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

/* Colors */
--color-background: #fbfcfe;
--background-mobile-color: #ffffff;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to stick with the other variable names and use something like --color-background-mobile

--color-test-notice-text: #e6a23d;
--color-test-notice-bg: #fefaf6;
--color-test-notice-border: #f6dcb7;
Expand All @@ -52,14 +53,16 @@
--color-html-text: #555;
--color-html-link: #FF6D5A;

/* Border Radii */
/* Border Radius */
Comment on lines -55 to +56
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Radii" is the plural of "Radius" - no need to change this comment

--border-radius-card: 8px;
--border-radius-input: 6px;
--border-radius-clear-btn: 50%;

/* Spacing */
--padding-container-top: 24px;
--padding-mobile-container: 24px;
--padding-card: 24px;
--padding-mobile-card: 0px;
--padding-test-notice-vertical: 12px;
--padding-test-notice-horizontal: 24px;
--margin-bottom-card: 16px;
Expand Down Expand Up @@ -400,23 +403,23 @@

@media only screen and (max-width: 500px) {
body {
background-color: #ffffff;
background-color: var(--background-mobile-color);
}
hr {
display: block;
}
.container {
width: 95%;
min-height: 100vh;
padding: 24px;
background-color: #ffffff;
padding: var(--padding-mobile-container);
background-color: var(--background-mobile-color);
border: 0px solid var(--color-input-border);
border-radius: 0px;
box-shadow: 0px 0px 0px 0px #ffffff;
}
.card {
padding: 0px;
background-color: #ffffff;
padding: var(--padding-mobile-card);
background-color: var(--background-mobile-color);
border: 0px solid var(--color-input-border);
border-radius: 0px;
box-shadow: 0px 0px 0px 0px #ffffff;
Expand Down
17 changes: 7 additions & 10 deletions packages/nodes-base/nodes/Form/cssVariables.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export const cssVariables = `
:root {
--font-family: 'Open Sans', sans-serif;
--font-weight-normal: 400;
--font-weight-bold: 600;
/* Fonts */
--font-family: "Open Sans", sans-serif;
Comment on lines -3 to +4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though these variables are not used in form-trigger.handlebars, they are used in form-trigger-404.handlebars, form-trigger-409.handlebars and form-trigger-completion.handlebars. Do not remove those

--font-size-body: 12px;
--font-size-label: 14px;
--font-size-test-notice: 12px;
Expand All @@ -17,10 +16,10 @@ export const cssVariables = `
--font-size-html-h4: 14px;
--font-size-html-h5: 12px;
--font-size-html-h6: 10px;
--font-size-subheader: 14px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here - not used in form-trigger.handlebars, but used in form-trigger-404.handlebars, form-trigger-409.handlebars and form-trigger-completion.handlebars


/* Colors */
--color-background: #fbfcfe;
--background-mobile-color: #ffffff;
--color-test-notice-text: #e6a23d;
--color-test-notice-bg: #fefaf6;
--color-test-notice-border: #f6dcb7;
Expand All @@ -39,24 +38,22 @@ export const cssVariables = `
--color-required: #ff6d5a;
--color-clear-button-bg: #7e8186;
--color-html-text: #555;
--color-html-link: #ff6d5a;
--color-header-subtext: #7e8186;
--color-html-link: #FF6D5A;
Comment on lines -42 to +41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--color-header-subtext - again, not used in form-trigger.handlebars, but used in form-trigger-404.handlebars, form-trigger-409.handlebars and form-trigger-completion.handlebars. Also, why would you update the hex to be capitalized?


/* Border Radii */
/* Border Radius */
Comment on lines -45 to +43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

--border-radius-card: 8px;
--border-radius-input: 6px;
--border-radius-clear-btn: 50%;
--card-border-radius: 8px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here - not used in form-trigger.handlebars, but used in form-trigger-404.handlebars, form-trigger-409.handlebars and form-trigger-completion.handlebars


/* Spacing */
--padding-container-top: 24px;
--padding-mobile-container: 24px;
--padding-card: 24px;
--padding-mobile-card: 0px;
--padding-test-notice-vertical: 12px;
--padding-test-notice-horizontal: 24px;
--margin-bottom-card: 16px;
--padding-form-input: 12px;
--card-padding: 24px;
--card-margin-bottom: 16px;
Comment on lines -58 to -59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above


/* Dimensions */
--container-width: 448px;
Expand Down