CKeditor stripping allowed style attribute I've installed Colorbutton to my Drupal 8 site. 

I have enabled the button for Full HTML and For Basic HTML

I have allowed the attribute &lt;span style&gt; in the Basic HTML allowed attributes area. 

I have defined a set of hex value colors. 

When I edit a page the button appears and I can change font colors in the editor correctly, however, saving the page strips the attributes leaving only clean &lt;span&gt; tags...

what else am I suppose to do?

There is a simmilar question here, however in relation to colorbotton the documentation/README that comes with the module specifically states that we should be allowing &lt;span style&gt; in the allowed tags? Is their readme incorrect? 

The extension appears to add the color by adding the attribute style="color:#fff"&gt; How can I allow it to do this successfully?
Your problem comes from the "Limit allowed HTML tags" option. According to this post (for Drupal 7, but the same logic applies on D8), setting this option triggers XSS filter in order to remove dangerous tags.

As for Drupal 8, it uses the core Filter module and calls filterXss() method in \Drupal\editor\EditorXssFilter\Standard class. First line of this method is:

$dangerous_tags = ['script', 'style', 'link', 'embed', 'object'];


Hence, your style tag will always be removed with the "Limit allowed HTML tags" option set.

If you really wish to use inline style, you have to either:


unset the "Limit allowed HTML tags" option (which I do not recommend depending on the kind of users you give access to "Basic HTML" text format)
or use "Full HTML" text format


Best solution would be to rely on classes and styling in CSS stylesheets and inline styling should be used sparingly.

Hope this helps.