Skip to content

Commit

Permalink
scope parent styles to drop-in form container
Browse files Browse the repository at this point in the history
  • Loading branch information
slogsdon committed Sep 5, 2019
1 parent 5500e17 commit 62a72d3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/credit-card/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export function form(
target = el;
}

target.className = target.className + " secure-payment-form";

const gateway = getGateway();

if (gateway && gateway.getEnv(options) !== "production") {
Expand Down Expand Up @@ -115,6 +117,8 @@ export function trackReaderForm(
target = el;
}

target.className = target.className + " secure-payment-form";

const gateway = getGateway();

if (gateway && gateway.getEnv(options) !== "production") {
Expand Down
2 changes: 2 additions & 0 deletions src/echeck/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export function form(
target = el;
}

target.className = target.className + " secure-payment-form";

const gateway = getGateway();

if (gateway && gateway.getEnv(options) !== "production") {
Expand Down
2 changes: 2 additions & 0 deletions src/gift-and-loyalty/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export function form(
target = el;
}

target.className = target.className + " secure-payment-form";

const gateway = getGateway();

if (gateway && gateway.getEnv(options) !== "production") {
Expand Down
14 changes: 7 additions & 7 deletions src/internal/lib/styles/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,38 +139,38 @@ export const fieldStyles = {
};

export const parentStyles = {
body: {
".secure-payment-form": {
"font-family": "sans-serif",
},

label: {
".secure-payment-form label": {
color: "#555",
"font-size": "13px",
"font-weight": "bold",
"line-height": "1.5",
"text-transform": "uppercase",
},

"#ss-banner": {
".secure-payment-form #ss-banner": {
background: `transparent url(${imageBase}[email protected]) no-repeat left center`,
"background-size": "280px 34px",
height: "40px",
"margin-bottom": "7px",
},

div: {
".secure-payment-form div": {
display: "block",
},

iframe: {
".secure-payment-form iframe": {
width: "300px",
},

".form-row": {
".secure-payment-form .form-row": {
"margin-top": "10px",
},

".form-wrapper": {
".secure-payment-form .form-wrapper": {
display: "block",
margin: "10px auto",
width: "300px",
Expand Down

0 comments on commit 62a72d3

Please sign in to comment.