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
🔗 🐞 CSS not generating for all devices. Specially for tablet. (Related to #19894) - [ED-8329] #19924
Comments
Hello @sayedulsayem! Thank you for reporting this issue. A fix is already underway! 🙌 Best regards |
I've talked to @udidol to try to help you. Your widget logic is problematic. You have a slider control that updates the padding. But you are updating different CSS properties in different breakpoints.
It's a bad practice with side effects, we don't recommend doing that. The best way to achieve this is to create 3 different controls for $this->add_responsive_control(
'padding-left',
[
'label' => __('Padding Left', 'plugin-name'),
'type' => \Elementor\Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 500,
],
],
'default' => [
'size' => 10,
'unit' => 'px',
],
'selectors' => [
'{{WRAPPER}} .test' => 'padding-left:{{SIZE}}{{UNIT}}; padding-top: 0; padding-bottom: 0;',
],
]
); Or, even better, use the dimensions control: $this->add_responsive_control(
'padding',
[
'label' => esc_html__( 'Padding', 'textdomain' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px' ],
'selectors' => [
'{{WRAPPER}} .test' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
); Try to stick to the examples in the developer docs. We documented there only stable features. The use of |
The reported code simply demonstrates the issue. The actual case is a little more involved. I already know your mentioned process, but it won't cover my actual case. I want to generate different CSS for different devices which your mentioned method won't cover by using a slider or dimensions control. I want to place // file path: elementor-pro/modules/share-buttons/widgets/share-buttons.php line 312 to 326
$this->add_responsive_control(
'column_gap',
[
'label' => esc_html__( 'Columns Gap', 'elementor-pro' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' => 10,
],
'selectors' => [
'{{WRAPPER}}' => '--grid-side-margin: {{SIZE}}{{UNIT}}; --grid-column-gap: {{SIZE}}{{UNIT}}; --grid-row-gap: {{SIZE}}{{UNIT}}',
'(tablet) {{WRAPPER}}' => '--grid-side-margin: {{SIZE}}{{UNIT}}; --grid-column-gap: {{SIZE}}{{UNIT}}',
'(mobile) {{WRAPPER}}' => '--grid-side-margin: {{SIZE}}{{UNIT}}; --grid-column-gap: {{SIZE}}{{UNIT}}',
],
]
); You mentioned it won't cover additional breakpoints and in the future, you are going to remove it. Right now, I am not concerned with additional breakpoints. I will handle it on my own if needed. Conclusion: The actual issue is that it is not generating CSS for |
… [ED-8329] (#19883) ## PR Type What kind of change does this PR introduce? <!-- Please check the one that applies to this PR using "x" with no spaces eg: [x]. --> - [X] Bugfix - [ ] Feature - [ ] Code style update (formatting, local variables) - [ ] Refactoring (no functional changes, no api changes) - [ ] Build related changes - [ ] CI related changes - [ ] Documentation content changes - [ ] Other... Please describe: ## Summary This PR can be summarized in the following changelog entry: * Fix: Custom background position not inherited on mobile and front end (Fixes: #19924) * Fix: Responsive controls with responsive conditions whose values are arrays (Base Multiple) did not apply in the front end for non-desktop devices. * Fix: In certain edge cases, third party addons crash pages since v3.7.7 (Fixes: #19917, #19922 as well as problems raised in the comments of #19894) ## Description An explanation of what is done in this PR * If a responsive control was conditioned upon another responsive control, and that conditioning control was a Base Multiple control (which means - the control value was an array(PHP)/object(JS) - such as Slider controls [size, unit]) - the responsive values were not applied in the front end
This issue has been resolved in Elementor v3.8.0-beta-5 Feel free to update Thanks! |
@arielk @nicholaszein Seems that this issue still persists in the case where the widget/control is added in a Footer template and then added in another page using Shortcode. On the page that the shortcode is embedded, the responsive styles don't seem to be pulled in and outputted in the frontend CSS. |
Hello @parasshah195! Thanks for giving your feedback. I'll discuss this with my manager and see if I can reproduce what you mentioned here. 🙏 |
I have noticed this behavour with templates. While we are waiting for a fix, I believe the correct css is regenerated when you click on Elementor > Tools > Regenerate CSS. |
@parasshah195 @nicholaszein |
Prerequisites
Description
Hello. To demonstrate the error I've created a simple widget:
I changed my code from
to this for making it compatible with Elementor 3.7.7 cause the previous code was throwing errors like this issue: #19894
So, I changed my code like the below.
The following code is not generating CSS for tablets. It was taking only mobile value.
For example, I input the padding value
desktop = 100px
,tablet = 80px
andmobile = 50px
.here is the output of generated CSS
which is not correct. The expected generated CSS should be like
I hope you guys are going to take a look at that matter and provide feedback.
Steps to reproduce
post-<post-id>.css
which I already told you in the description.Isolating the problem
System Info
Click to reveal
The text was updated successfully, but these errors were encountered: