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

[Bug] CSS properties doesn't exist in type error when using in React and TypeScript combination project #624

Open
velprathap opened this issue Feb 12, 2025 · 0 comments

Comments

@velprathap
Copy link

velprathap commented Feb 12, 2025

Library used

@paypal/react-paypal-js

🐞 Describe the Bug

As I am trying to customize the CardFields, For example trying to style the NameField with no box-shadow (i.e. boxShadow: none), but it shows that this property doesn't exist in the type. Similarly facing issue for border as well. So, due to this issue I can't customize the CardFields with my own style.

I can see these properties in the Supported CSS properties list in the below link:

https://developer.paypal.com/docs/checkout/advanced/customize/card-field-style/

But when I check the types in the source level, I don't see this property in the list (file path: https://github.com/paypal/paypal-js/blob/main/packages/react-paypal-js/src/types/payPalCardFieldsTypes.ts).

export type CardFieldStyle = {
appearance?: string;
background?: string;
color?: string;
direction?: string;
font?: string;
fontFamily?: string;
fontSizeAdjust?: string;
fontSize?: string;
fontStretch?: string;
fontStyle?: string;
fontVariantAlternates?: string;
fontVariantCaps?: string;
fontVariantEastAsian?: string;
fontVariantLigatures?: string;
fontVariantNumeric?: string;
fontVariant?: string;
fontWeight?: string;
height?: string;
letterSpacing?: string;
lineHeight?: string;
opacity?: string;
outline?: string;
padding?: string;
paddingTop?: string;
paddingRight?: string;
paddingBottom?: string;
paddingLeft?: string;
textShadow?: string;
transition?: string;
MozApperance?: string;
MozOsxFontSmoothing?: string;
MozTapHighlightColor?: string;
MozTransition?: string;
WebkitAppearance?: string;
WebkitOsxFontSmoothing?: string;
WebkitTapHighlightColor?: string;
WebkitTransition?: string;
};

🔬 Minimal Reproduction

React + TypeScript Codesandbox Sample
https://codesandbox.io/p/sandbox/7dm8tm?file=%2Fsrc%2FApp.tsx%3A78%2C19

  • Add the boxShadow: none as shown in the below screenshot, you will see the warning message of doesn't exist in type.

Image

Image

😕 Actual Behavior

Showing the box shadow on the focus.

Image

🤔 Expected Behavior

After applying the style, we should not see the box-shadow on focus the field.

🌍 Environment

  • Node.js/npm: -Node V20.15.0
  • OS: - Windows
  • Browser: -

➕ Additional Context

Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant