Chris@909: module CodeRay Chris@909: module Styles Chris@909: Chris@909: # A colorful theme using CSS 3 colors (with alpha channel). Chris@909: class Alpha < Style Chris@909: Chris@909: register_for :alpha Chris@909: Chris@909: code_background = 'hsl(0,0%,95%)' Chris@909: numbers_background = 'hsl(180,65%,90%)' Chris@909: border_color = 'silver' Chris@909: normal_color = 'black' Chris@909: Chris@909: CSS_MAIN_STYLES = <<-MAIN # :nodoc: Chris@909: .CodeRay { Chris@909: background-color: #{code_background}; Chris@909: border: 1px solid #{border_color}; Chris@909: color: #{normal_color}; Chris@909: } Chris@909: .CodeRay pre { Chris@909: margin: 0px; Chris@909: } Chris@909: Chris@909: span.CodeRay { white-space: pre; border: 0px; padding: 2px; } Chris@909: Chris@909: table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px; } Chris@909: table.CodeRay td { padding: 2px 4px; vertical-align: top; } Chris@909: Chris@909: .CodeRay .line-numbers { Chris@909: background-color: #{numbers_background}; Chris@909: color: gray; Chris@909: text-align: right; Chris@909: -webkit-user-select: none; Chris@909: -moz-user-select: none; Chris@909: user-select: none; Chris@909: } Chris@909: .CodeRay .line-numbers a { Chris@909: background-color: #{numbers_background} !important; Chris@909: color: gray !important; Chris@909: text-decoration: none !important; Chris@909: } Chris@909: .CodeRay .line-numbers a:target { color: blue !important; } Chris@909: .CodeRay .line-numbers .highlighted { color: red !important; } Chris@909: .CodeRay .line-numbers .highlighted a { color: red !important; } Chris@909: .CodeRay span.line-numbers { padding: 0px 4px; } Chris@909: .CodeRay .line { display: block; float: left; width: 100%; } Chris@909: .CodeRay .code { width: 100%; } Chris@909: .CodeRay .code pre { overflow: auto; } Chris@909: MAIN Chris@909: Chris@909: TOKEN_COLORS = <<-'TOKENS' Chris@909: .debug { color: white !important; background: blue !important; } Chris@909: Chris@909: .annotation { color:#007 } Chris@909: .attribute-name { color:#b48 } Chris@909: .attribute-value { color:#700 } Chris@909: .binary { color:#509 } Chris@909: .char .content { color:#D20 } Chris@909: .char .delimiter { color:#710 } Chris@909: .char { color:#D20 } Chris@909: .class { color:#B06; font-weight:bold } Chris@909: .class-variable { color:#369 } Chris@909: .color { color:#0A0 } Chris@909: .comment { color:#777 } Chris@909: .comment .char { color:#444 } Chris@909: .comment .delimiter { color:#444 } Chris@909: .complex { color:#A08 } Chris@909: .constant { color:#036; font-weight:bold } Chris@909: .decorator { color:#B0B } Chris@909: .definition { color:#099; font-weight:bold } Chris@909: .delimiter { color:black } Chris@909: .directive { color:#088; font-weight:bold } Chris@909: .doc { color:#970 } Chris@909: .doc-string { color:#D42; font-weight:bold } Chris@909: .doctype { color:#34b } Chris@909: .entity { color:#800; font-weight:bold } Chris@909: .error { color:#F00; background-color:#FAA } Chris@909: .escape { color:#666 } Chris@909: .exception { color:#C00; font-weight:bold } Chris@909: .float { color:#60E } Chris@909: .function { color:#06B; font-weight:bold } Chris@909: .global-variable { color:#d70 } Chris@909: .hex { color:#02b } Chris@909: .imaginary { color:#f00 } Chris@909: .include { color:#B44; font-weight:bold } Chris@909: .inline { background-color: hsla(0,0%,0%,0.07); color: black } Chris@909: .inline-delimiter { font-weight: bold; color: #666 } Chris@909: .instance-variable { color:#33B } Chris@909: .integer { color:#00D } Chris@909: .key .char { color: #60f } Chris@909: .key .delimiter { color: #404 } Chris@909: .key { color: #606 } Chris@909: .keyword { color:#080; font-weight:bold } Chris@909: .label { color:#970; font-weight:bold } Chris@909: .local-variable { color:#963 } Chris@909: .namespace { color:#707; font-weight:bold } Chris@909: .octal { color:#40E } Chris@909: .operator { } Chris@909: .predefined { color:#369; font-weight:bold } Chris@909: .predefined-constant { color:#069 } Chris@909: .predefined-type { color:#0a5; font-weight:bold } Chris@909: .preprocessor { color:#579 } Chris@909: .pseudo-class { color:#00C; font-weight:bold } Chris@909: .regexp .content { color:#808 } Chris@909: .regexp .delimiter { color:#404 } Chris@909: .regexp .modifier { color:#C2C } Chris@909: .regexp { background-color:hsla(300,100%,50%,0.06); } Chris@909: .reserved { color:#080; font-weight:bold } Chris@909: .shell .content { color:#2B2 } Chris@909: .shell .delimiter { color:#161 } Chris@909: .shell { background-color:hsla(120,100%,50%,0.06); } Chris@909: .string .char { color: #b0b } Chris@909: .string .content { color: #D20 } Chris@909: .string .delimiter { color: #710 } Chris@909: .string .modifier { color: #E40 } Chris@909: .string { background-color:hsla(0,100%,50%,0.05); } Chris@909: .symbol .content { color:#A60 } Chris@909: .symbol .delimiter { color:#630 } Chris@909: .symbol { color:#A60 } Chris@909: .tag { color:#070 } Chris@909: .type { color:#339; font-weight:bold } Chris@909: .value { color: #088; } Chris@909: .variable { color:#037 } Chris@909: Chris@909: .insert { background: hsla(120,100%,50%,0.12) } Chris@909: .delete { background: hsla(0,100%,50%,0.12) } Chris@909: .change { color: #bbf; background: #007; } Chris@909: .head { color: #f8f; background: #505 } Chris@909: .head .filename { color: white; } Chris@909: Chris@909: .delete .eyecatcher { background-color: hsla(0,100%,50%,0.2); border: 1px solid hsla(0,100%,45%,0.5); margin: -1px; border-bottom: none; border-top-left-radius: 5px; border-top-right-radius: 5px; } Chris@909: .insert .eyecatcher { background-color: hsla(120,100%,50%,0.2); border: 1px solid hsla(120,100%,25%,0.5); margin: -1px; border-top: none; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; } Chris@909: Chris@909: .insert .insert { color: #0c0; background:transparent; font-weight:bold } Chris@909: .delete .delete { color: #c00; background:transparent; font-weight:bold } Chris@909: .change .change { color: #88f } Chris@909: .head .head { color: #f4f } Chris@909: TOKENS Chris@909: Chris@909: end Chris@909: Chris@909: end Chris@909: end