#rabi-elements-appearance

1 messages · Page 1 of 1 (latest)

vital vineBOT
humble mountain
#

@flat brook Can you provide a bit more details and context? There are numerous ways to integrate Stripe and many UI components. What are you really trying to do, what does your code look like, what have you tried?

#

rabi-elements-appearance

flat brook
#

I'm using wordpress woocommerce.

humble mountain
#

that's just a picture

flat brook
#

When i try to overwrite css it's not changing te color

humble mountain
#

But if you use a third-party system we can't really help here. We don't write or control that code and you can't control that code either. Have you spoken to the developers of that plugin?

flat brook
#

I'm using stripe plugin and this is my website i have an access all the files

humble mountain
#

Ah gotcha, you mentioned "wordpress woocommerce" without any context I asked so I assumed it was their official plugin

#

So ignoring the picture: What does your code look like, what did you try, what's not working?

flat brook
#

sure I am sharing the css and php code as well

humble mountain
#

I don't need any PHP. This is a client-side UI, it should be purely Javascript and explaining exactly what integration you're using

flat brook
#

#wc-stripe-cc-form input{
color:#fff !important;
}
#stripe-payment-data input{
color:#fff !important;
}
.ElementsApp .InputElement {
color: #fff !important;
font-size: 15px;
}
.ElementsApp .InputElement::after {
color: #fff !important;
font-size: 15px;
}

#

.wc-stripe-elements-field{
border: 1px solid #ddd;
color: #ffff !important;
margin: 5px 0;
padding: 20px 10px !important;
background-color: transparent ;
}

humble mountain
#

yeah you can't do that

#

you can't just go and force override our CSS that way

flat brook
#

Oh

humble mountain
#

Which element are you using? CardElement or PaymentElement?

flat brook
#

I'm using credit card option

#

this one

humble mountain
#

you have to use this when you initialize/mount that element

flat brook
#

can you simply share the code so i can replace it? it would be very easy for me

humble mountain
#

I can not sorry, this is your job as the developer, I can't write your code

flat brook
#

do i need to add this code in js?

var element = elements.create('card', {
style: {
base: {
iconColor: '#c4f0ff',
color: '#fff',
fontWeight: '500',
fontFamily: 'Roboto, Open Sans, Segoe UI, sans-serif',
fontSize: '16px',
fontSmoothing: 'antialiased',
':-webkit-autofill': {
color: '#fce883',
},
'::placeholder': {
color: '#87BBFD',
},
},
invalid: {
iconColor: '#FFC7EE',
color: '#FFC7EE',
},
},
});

#

and change the color code only?

humble mountain
#

Step 1: try it, see what happens

flat brook
#

getting this error Uncaught ReferenceError: elements is not defined

humble mountain
#

Did you define that variable anywhere?

flat brook
#

no i just copy the code from the link you shared

humble mountain
#

Okay then that can;t work right?

flat brook
#

yeah

humble mountain
#

You're the developer, you said you integrated Stripe yourself adn wrote all the code. Your code must already be creating that card element instance somewhere

#

So what you need to do is find the bit of code that does that elements.create('card',...) and modify it to pass the custom style

flat brook
#

i just install the plugin the in wordpress and i'm using woocommerce for my e-com website everything works fine but what i can't do is just change the text color of stripe paymentt input fields

#

I'm trying to find why it's so complicated just to change the text color

humble mountain
#

see, now you say you installed a plugin, I asked earlier and you said no

#

It's complicated because you just installed someone else's code they wrote and you don't have control over it

#

if you write your own integration, it's really easy to style. If you use someone else's code you can;t, not unless you read their code and change it

flat brook
#

yeah but i'm using stripe offical plugins for woocommerce websites

humble mountain
#

I mean sure but the whole point of the plugin is that you install it and it works, not that you are allowed to go and change its code. It was also built by WooCommerce not Stripe (we know nothing about it)

#

Ultimately: what you want to do is impossible. Either you use the plugin as is (and the style options would be a feature request for them to build) or you build this yourself (and then the docs I shared would allow you to do that)
I unfortunately can't think of a better way

flat brook
#

can i use this code to modify css
<?php
function my_theme_modify_stripe_fields_styles( $styles ) {
return array(
'base' => array(
'iconColor' => '#666EE8',
'color' => '#31325F',
'fontSize' => '15px',
'::placeholder' => array(
'color' => '#CFD7E0',
),
),
);
}

add_filter( 'wc_stripe_elements_styling', 'my_theme_modify_stripe_fields_styles' );

humble mountain
#

no you can't

flat brook
#

reason?

humble mountain
#

Because it will not work? To style our UI elements, which are in an iframe you have no control over, you need to pass the style when you initialize said UI elements, with the code I shared. For that to work, that third-party WP function needs to get the style and pass this to our UI element.

Maybe this is already implemented in the plugin you use, but I don't know that plugin's code and whether that's what you're trying to say or do.

flat brook
#

so when your customer install plugin in wprdpress site they don't edit even input text color ? i think it's so wired cause stripe plugin have millions of activation on wordpress with woocommerce