#rabi-elements-appearance
1 messages · Page 1 of 1 (latest)
@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
I'm using wordpress woocommerce.
that's just a picture
When i try to overwrite css it's not changing te color
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?
I'm using stripe plugin and this is my website i have an access all the files
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?
sure I am sharing the css and php code as well
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
#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 ;
}
Oh
Which element are you using? CardElement or PaymentElement?
can you simply share the code so i can replace it? it would be very easy for me
I can not sorry, this is your job as the developer, I can't write your code
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?
Step 1: try it, see what happens
getting this error Uncaught ReferenceError: elements is not defined
Did you define that variable anywhere?
no i just copy the code from the link you shared
Okay then that can;t work right?
yeah
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
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
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
yeah but i'm using stripe offical plugins for woocommerce websites
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
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' );
no you can't
reason?
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.
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