/plugins/editors/codemirror/layouts/editors/codemirror/styles.php

https://github.com/pjwiseman/joomla-cms · PHP · 72 lines · 51 code · 9 blank · 12 comment · 2 complexity · 0d9d63cfc8ac8b993e6d370427c3f1d8 MD5 · raw file

  1. <?php
  2. /**
  3. * @package Joomla.Plugin
  4. * @subpackage Editors.codemirror
  5. *
  6. * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. // No direct access
  10. defined('_JEXEC') or die;
  11. $params = $displayData->params;
  12. $fontFamily = isset($displayData->fontFamily) ? $displayData->fontFamily : 'monospace';
  13. $fontSize = $params->get('fontSize', 13) . 'px;';
  14. $lineHeight = $params->get('lineHeight', 1.2) . 'em;';
  15. // Set the active line color.
  16. $color = $params->get('activeLineColor', '#a4c2eb');
  17. $r = hexdec($color{1} . $color{2});
  18. $g = hexdec($color{3} . $color{4});
  19. $b = hexdec($color{5} . $color{6});
  20. $activeLineColor = 'rgba(' . $r . ', ' . $g . ', ' . $b . ', .5)';
  21. // Set the color for matched tags.
  22. $color = $params->get('highlightMatchColor', '#fa542f');
  23. $r = hexdec($color{1} . $color{2});
  24. $g = hexdec($color{3} . $color{4});
  25. $b = hexdec($color{5} . $color{6});
  26. $highlightMatchColor = 'rgba(' . $r . ', ' . $g . ', ' . $b . ', .5)';
  27. ?>
  28. <?php // We don't actually want a script tag but this will cause text editors to switch to css mode ?>
  29. <?php if (false) : ?><style type="text/css"><?php endif; ?>
  30. .CodeMirror
  31. {
  32. font-family: <?php echo $fontFamily; ?>;
  33. font-size: <?php echo $fontSize; ?>;
  34. line-height: <?php echo $lineHeight; ?>;
  35. border: 1px solid #ccc;
  36. }
  37. /* In order to hid the Joomla menu */
  38. .CodeMirror-fullscreen
  39. {
  40. z-index: 1040;
  41. }
  42. /* Make the fold marker a little more visible/nice */
  43. .CodeMirror-foldmarker
  44. {
  45. background: rgb(255, 128, 0);
  46. background: rgba(255, 128, 0, .5);
  47. box-shadow: inset 0 0 2px rgba(255, 255, 255, .5);
  48. font-family: serif;
  49. font-size: 90%;
  50. border-radius: 1em;
  51. padding: 0 1em;
  52. vertical-align: middle;
  53. color: white;
  54. text-shadow: none;
  55. }
  56. .CodeMirror-foldgutter, .CodeMirror-markergutter { width: 1.2em; text-align: center; }
  57. .CodeMirror-markergutter { cursor: pointer; }
  58. .CodeMirror-markergutter-mark { cursor: pointer; text-align: center; }
  59. .CodeMirror-markergutter-mark:after { content: "\25CF"; }
  60. .CodeMirror-activeline-background { background: <?php echo $activeLineColor; ?>; }
  61. .CodeMirror-matchingtag { background: <?php echo $highlightMatchColor; ?>; }
  62. <?php // And now switch it off ?>
  63. <?php if (false) : ?></style><?php endif; ?>