Skip to content

Border With 0px Not Working #1254

@ashleyfae

Description

@ashleyfae

When I enter in a border width as having "0px" it doesn't output correctly in the CSS. Here's an example:

array(
    'id' => 'widget_title_border',
    'type' => 'border',
    'output' => array('.widgettitle'),
    'title' => __('Widget Title Border', 'redux-framework-demo'),
    'subtitle' => __('The border around the widget titles.', 'redux-framework-demo'),
    'all' => false,
    'default' => array(
        'border-color'  =>  '#07778D',
        'border-style'  =>  'solid',
        'border-top'    =>  '1px',
        'border-right'  =>  '0px',
        'border-bottom' =>  '1px',
        'border-left'   =>  '0px',
    )
),

The outputted CSS is something like this:

.widgettitle{border-top:1px solid #07778D;border-bottom:1px solid #07778D;border-left: solid #07778D;border-right: solid #07778D;}

So instead of the left and right outputting border-left:0px solid #07778D, it outputs no width value, so then it just uses one of the other set values (1px, in this case).

Then, when editing in the settings panel, I noticed that the hidden field looked like this:

<input type="text" class="redux-border-right redux-border-input mini" placeholder="Right" rel="widget_title_border-right" value="0">

If I edit that field to something other than 0 (like 1), then edit it back to 0, it changes to:

<input type="text" class="redux-border-right redux-border-input mini" placeholder="Right" rel="widget_title_border-right" value="0px">

(so 0px instead of 0)

Then if I save, it outputs "0px" correctly in the CSS. However, if I go BACK to the settings panel and edit something else (not touching the border values), it gets set back to "0" instead of "0px" and doesn't work again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions