question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] Unique ID on block content without inline style

See original GitHub issue

Hi All,

I made a custom block manager element, but when the element is edited, it applies the style to the class, which means all the same elements are also impacted. If I set an inline style to the element, it then applies the style to the custom class / ID.

Without in line style: image

Code:


        editor.BlockManager.add('column_1', {
            label: 'Column 1',
            category: 'Basic',
            content: `
                    <div class="row gjs-row">
                        <div class='col-md-12 gjs-column'>
                        </div>
                     </div>`
        });


With inline style: image

Code:


        editor.BlockManager.add('column_1', {
            label: 'Column 1',
            category: 'Basic',
            content: `
                    <div class="row gjs-row" ${row_style}>
                        <div class='col-md-12 gjs-column' ${column_style}>
                        </div>
                     </div>`
        });

Is it possible to force the style manager (my be the wrong name) to create the custom ID / Class and then apply the style to that? Instead of amending the noncustom class?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
adamwpecommented, Apr 8, 2020

@pouyamiralayi

My bad - worked it out, I had some old ‘CssComposer.setRule’ still hanging about!!! (since I had debug enabled on my development pc) That was appending the .row class. (That is embarrassing)

Thanks for the point in the right direction regarding the selector ‘private: false’ - it’s working a treat 😃 - keep uncovering more and more of this amazing project.

Case closed! 😃

1reaction
pouyamiralayicommented, Apr 8, 2020

@adamwpe can you confirm that by deactivating row selector: active:false in the add:selector event, you are still receiving the selector?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inline elements - HTML: HyperText Markup Language | MDN
In this article, we'll examine HTML inline-level elements and how they differ from block-level elements.
Read more >
Using CSS :before and :after pseudo-elements with inline CSS?
I came here looking for how to apply pseudo selectors in inline CSS and this answer showed me another way to achieve the...
Read more >
Inline Styles in HTML - Codecademy
This problem can be created with any CSS, not just inline styles, but it is worth mentioning here. Always look for the right...
Read more >
HTML Block and Inline Elements - W3Schools
There are two display values: block and inline. ... The <div> element has no required attributes, but style , class and id are...
Read more >
Style Sheets in HTML documents - W3C
Setting the default style sheet language; Inline style information ... declaration block syntax described in section 4.1.8 (without curly brace delimiters).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found