File tree Expand file tree Collapse file tree 3 files changed +43
-1
lines changed
app/code/Magento/PageBuilder/view/adminhtml
css/source/content-type/banner Expand file tree Collapse file tree 3 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 276
276
<attribute name =" virtual_link_type" storage_key =" link_url" source =" data-link-type" converter =" Magento_PageBuilder/js/converter/attribute/link-type" persistence_mode =" write" />
277
277
</element >
278
278
<element name =" overlay" >
279
+ <style name =" border_radius" source =" border_radius" converter =" Magento_PageBuilder/js/converter/style/overlay-border-radius" />
279
280
<style name =" min_height" source =" min_height" converter =" Magento_PageBuilder/js/converter/style/remove-px" />
280
281
<style name =" background_color" source =" background_color" converter =" Magento_PageBuilder/js/content-type/banner/converter/style/overlay-background-color" persistence_mode =" write" />
281
282
<style name =" margins_and_padding" reader =" Magento_PageBuilder/js/property/paddings" converter =" Magento_PageBuilder/js/converter/style/paddings" />
Original file line number Diff line number Diff line change 15
15
-moz-transition : background- color 500ms ease ;
16
16
-o-transition : background- color 500ms ease ;
17
17
-webkit-transition : background- color 500ms ease ;
18
- border-radius : inherit ;
19
18
transition : background- color 500ms ease ;
20
19
}
21
20
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ import { DataObject } from "../../data-store" ;
7
+ import ConverterInterface from "../converter-interface" ;
8
+
9
+ /**
10
+ * Takes difference of border width from border radius to conform snugly to edges of wrapper border
11
+ *
12
+ * @api
13
+ */
14
+ export default class OverlayBorderRadius implements ConverterInterface {
15
+ /**
16
+ * Convert value to internal format
17
+ *
18
+ * @param value string
19
+ * @returns {string }
20
+ */
21
+ public fromDom ( value : string ) : string | object {
22
+ return value ;
23
+ }
24
+
25
+ /**
26
+ * Convert value to knockout format
27
+ *
28
+ * @param {string } name
29
+ * @param {DataObject } data
30
+ * @returns {string }
31
+ */
32
+ public toDom ( name : string , data : DataObject ) : string | object {
33
+ const borderRadius = data . border_radius ? parseInt ( data . border_radius as string , 10 ) : 0 ;
34
+ const borderWidth = data . border_width ? parseInt ( data . border_width as string , 10 ) : 0 ;
35
+
36
+ if ( borderRadius <= borderWidth ) {
37
+ return "0" ;
38
+ }
39
+
40
+ return ( borderRadius - borderWidth ) + "px" ;
41
+ }
42
+ }
You can’t perform that action at this time.
0 commit comments