diff --git a/geshifilter.module b/geshifilter.module
index 0746b92..eba9407 100644
--- a/geshifilter.module
+++ b/geshifilter.module
@@ -7,6 +7,7 @@
 
 // Necessary for URL.
 use Drupal\geshifilter\GeshiFilterCss;
+use Drupal\geshifilter\GeshiFilter;
 use Drupal\Core\Url;
 use Drupal\Core\Routing\RouteMatchInterface;
 
@@ -91,9 +92,12 @@ function geshifilter_libraries_info() {
  */
 function geshifilter_library_info_alter(&$libraries, $extension) {
   if ($extension == 'geshifilter') {
-    $css = drupal_realpath(GeshiFilterCss::languageCssPath());
-    $base = DRUPAL_ROOT;
-    $name = substr($css, strlen($base));
-    $libraries['geshifilter']['css']['component'][$name] = [];
+    $config = \Drupal::config('geshifilter.settings');
+    // Add the language CSS file if CSS classes are used for code styling.
+    if ($config->get('css_mode') == GeshiFilter::CSS_CLASSES_AUTOMATIC) {
+      $css = drupal_realpath(GeshiFilterCss::languageCssPath());
+      $name = substr($css, strlen(DRUPAL_ROOT));
+      $libraries['geshifilter']['css']['component'][$name] = [];
+    }
   }
 }
diff --git a/src/Plugin/Filter/GeshiFilterFilter.php b/src/Plugin/Filter/GeshiFilterFilter.php
index 944340e..cbcf4ba 100644
--- a/src/Plugin/Filter/GeshiFilterFilter.php
+++ b/src/Plugin/Filter/GeshiFilterFilter.php
@@ -107,7 +107,7 @@ class GeshiFilterFilter extends FilterBase {
       $result = new FilterProcessResult($text);
 
       // Add the css file when necessary.
-      if ($this->config->get('css_mode') == GeshiFilter::CSS_CLASSES_AUTOMATIC) {
+      if (in_array($this->config->get('css_mode'), [GeshiFilter::CSS_CLASSES_AUTOMATIC, GeshiFilter::CSS_INLINE])) {
         $result->setAttachments([
           'library' => [
             'geshifilter/geshifilter',
diff --git a/tests/src/Functional/GeshiFilterCssTest.php b/tests/src/Functional/GeshiFilterCssTest.php
index 1d6a861..5d3172c 100644
--- a/tests/src/Functional/GeshiFilterCssTest.php
+++ b/tests/src/Functional/GeshiFilterCssTest.php
@@ -83,30 +83,107 @@ class GeshiFilterCssTest extends BrowserTestBase {
     // Test if we can generate the css.
     $this->drupalGet('admin/config/content/formats/geshifilter/generate_css');
     $this->assertRaw('GeSHi Dynamically Generated Stylesheet', 'Test for geshifilter generate css');
+  }
+
+  /**
+   * Test the use of css when CSS mode for syntax highlighting is inline.
+   *
+   * In this case we have geshifilter.css and no geshi-languages.css.
+   */
+  public function testCssInline() {
+    // Node Content.
+    $node = [
+      'title' => 'Test for GeShi Filter',
+      'body' => [
+        [
+          'value' => "dfgdfg <code language=\"php\">echo(\"hi\");</code> dfgdg",
+          'format' => 'geshifilter_text_format',
+        ],
+      ],
+      'type' => 'geshifilter_content_type',
+    ];
 
+    // Inline CSS.
     $form_values = [
-      'css_mode' => 2,
+      'css_mode' => 1,
     ];
     $this->drupalPostForm('admin/config/content/formats/geshifilter', $form_values, t('Save configuration'));
 
-    // Create a node.
+    // Create the node and read it.
+    $this->drupalCreateNode($node);
+    $this->drupalGet('node/1');
+
+    // Test if we have only geshifilter.css.
+    $this->assertRaw('/assets/css/geshifilter.css', 'The CSS file /assets/css/geshifilter.css is present.');
+    $this->assertNoRaw('/geshi/geshifilter-languages.css', 'The CSS file /geshi/geshifilter-languages.css is present.');
+  }
+
+  /**
+   * Test the css when CSS mode for syntax highlighting is external managed.
+   *
+   * In this case we have both geshifilter.css and geshi-languages.css.
+   */
+  public function testCssExternal() {
+    // Node Content.
     $node = [
       'title' => 'Test for GeShi Filter',
       'body' => [
         [
-          'value' => 'dfgdfg <code language="php">echo("hi");</code> dfgdg',
+          'value' => "dfgdfg <code language=\"php\">echo(\"hi\");</code> dfgdg",
           'format' => 'geshifilter_text_format',
         ],
       ],
       'type' => 'geshifilter_content_type',
     ];
+
+    // External managed CSS.
+    $form_values = [
+      'css_mode' => 2,
+    ];
+    $this->drupalPostForm('admin/config/content/formats/geshifilter', $form_values, t('Save configuration'));
+
+    // Create the node and read it.
     $this->drupalCreateNode($node);
     $this->drupalGet('node/1');
+
+    // Test if we have both css.
     $this->assertRaw('/assets/css/geshifilter.css', 'The CSS file /assets/css/geshifilter.css is present.');
     $this->assertRaw('/geshi/geshifilter-languages.css', 'The CSS file /geshi/geshifilter-languages.css is present.');
   }
 
   /**
+   * Test the use of css when CSS mode for syntax highlighting is only add css.
+   *
+   * In this case we do not have both geshifilter.css and geshi-languages.css.
+   */
+  public function testOnlyCss() {
+    // Node Content.
+    $node = [
+      'title' => 'Test for GeShi Filter',
+      'body' => [
+        [
+          'value' => "dfgdfg <code language=\"php\">echo(\"hi\");</code> dfgdg",
+          'format' => 'geshifilter_text_format',
+        ],
+      ],
+      'type' => 'geshifilter_content_type',
+    ];
+    // Only CSS.
+    $form_values = [
+      'css_mode' => 3,
+    ];
+    $this->drupalPostForm('admin/config/content/formats/geshifilter', $form_values, t('Save configuration'));
+
+    // Create the node and read it.
+    $this->drupalCreateNode($node);
+    $this->drupalGet('node/1');
+
+    // Test if we have both css.
+    $this->assertNoRaw('/assets/css/geshifilter.css', 'The CSS file /assets/css/geshifilter.css is present.');
+    $this->assertNoRaw('/geshi/geshifilter-languages.css', 'The CSS file /geshi/geshifilter-languages.css is present.');
+  }
+
+  /**
    * Create a new text format.
    *
    * @param string $format_name
