CKEditor strips all inline CSS and some tokens
See 


https://drupal.stackexchange.com/a/282373/79805
https://stackoverflow.com/a/60836391/9302793
https://drupal.stackexchange.com/a/215158/79805


for some further reference :)



You could try using custom CKEditor styles. For using custom styles you'll need a custom module.


MYMODULE/


/MYMODULE.module
/MYMODULE.libraries.yml
/css/style.css



MYMODULE/MYMODULE.module:

function MYMODULE_editor_js_settings_alter(array &amp;$settings) {


  foreach ($settings['editor']['formats'] as $name =&gt; $value) {

    // You can check for specific editors.
    // if ($settings['editor']['formats'] == 'basic_html') {
    //
    // }


    // Otherwise, add our custom styles to all editors.
    $settings['editor']['formats'][$name]['editorSettings']['stylesSet'] = [

      [
        'name' =&gt; 'Custom Color Text',
        'element' =&gt; 'p',
        'attributes' =&gt; [
          'class' =&gt; "custom-color-text"
        ]
      ],
      [
        'name' =&gt; 'Custom Color Link',
        'element' =&gt; 'a',
        'attributes' =&gt; [
          'class' =&gt; "custom-color-link"
        ]
      ],
    ];
  }
}

function MYMODULE_preprocess_node(&amp;$variables) {

  // Attach our styles library.
  $variables['#attached']['library'][] = 'MYMODULE/styles';
}

// Nice to haves:
function MYMODULE_ckeditor_css_alter(&amp;$css, $editor) {

  // Add our ckeditor style sheet to ckeditor.

  // This adds our theme styles to the editor field.
  $css[] = drupal_get_path('theme', 'MYTHEME') . '/css/style.css';

  // This adds our styles from the module directory.
  $css[] = drupal_get_path('module', 'MYMODULE') . '/css/style.css';
}


MYMODULE/css/style.css:

.custom-color-text {
  color: #f00;
}

.custom-color-link {
  color: #00f;
}


MYMODULE/MYMODULE.libraries.yml:

styles:
  version: 1.x
  css:
    theme:
      css/style.css: {}


These will now be available in the "style" dropdown in the CKEditor field.