File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/code/Magento/PageBuilder/Setup/Converters Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 18
18
*/
19
19
class PageBuilderStripStyles implements DataConverterInterface
20
20
{
21
+ const BODY_ID = 'html-body ' ;
22
+ const DATA_ATTRIBUTE = 'data-pb-style ' ;
23
+
21
24
/**
22
25
* @var DOMDocument
23
26
*/
@@ -52,7 +55,7 @@ private function generateInternalStyles(array $styleMap): string
52
55
$ output = '' ;
53
56
54
57
foreach ($ styleMap as $ selector => $ styles ) {
55
- $ output .= '[data-pb-style =" ' . $ selector . '"] ' ;
58
+ $ output .= '# ' . self :: BODY_ID . ' [ ' . self :: DATA_ATTRIBUTE . ' =" ' . $ selector . '"] ' ;
56
59
$ output .= '{ ' . $ styles . '} ' ;
57
60
}
58
61
@@ -80,7 +83,7 @@ public function convert($value)
80
83
81
84
if ($ styleAttr ) {
82
85
$ generatedDataAttribute = $ this ->generateDataAttribute ();
83
- $ node ->setAttribute (' data-pb-style ' , $ generatedDataAttribute );
86
+ $ node ->setAttribute (self :: DATA_ATTRIBUTE , $ generatedDataAttribute );
84
87
$ styleMap [$ generatedDataAttribute ] = $ styleAttr ; // Amend Array for Internal Style Generation
85
88
$ node ->removeAttribute ('style ' );
86
89
}
You can’t perform that action at this time.
0 commit comments