@import "syntax-variables";

atom-text-editor {
    background-color: @syntax-background-color;
    color: @syntax-text-color;

    .wrap-guide {
        background-color: @syntax-indent-guide-color;
    }

    .indent-guide {
        color: @syntax-indent-guide-color;
    }

    .invisible-character {
        color: @syntax-invisible-character-color;
    }

    .cursor-line {
        background-color: fade(darken(@syntax-background-color, 20%), 20%);
    }

    .gutter {
        background-color: @syntax-gutter-background-color;
        color: @syntax-gutter-text-color;

        .line-number {
            &.cursor-line {
                background-color: darken(@syntax-background-color, 2.5%);
                color: @syntax-gutter-text-color-selected;
            }

            &.cursor-line-no-selection {
                color: @syntax-gutter-text-color-selected;
            }
        }
    }

    .fold-marker:after,
    .gutter .line-number.folded,
    .gutter .line-number:after {
        color: @light-gray;
    }

    .invisible {
        color: @syntax-text-color;
    }

    .cursor {
        color: @syntax-cursor-color;
        border-width: 2px;
    }

    .selection .region {
        background-color: @syntax-selection-color;
    }
}

atom-text-editor .search-results .syntax--marker .region {
    background-color: transparent;
    border: 1px solid @syntax-result-marker-color;
}

atom-text-editor .search-results .syntax--marker.current-result .region {
    border: 1px solid @syntax-result-marker-color-selected;
}

// Syntax styles
.syntax--comment {
    color: @syntax-comment-color;
}

.syntax--keyword {
    color: @purple;

    &.syntax--control {
        color: @purple;

        &.syntax--elements {
            color: @light-gray;
        }
    }

    &.syntax--operator {
        color: @cyan;
    }

    &.syntax--other.syntax--special-method {
        color: @blue;
    }

    &.syntax--other.syntax--unit {
        color: @orange;
    }
}

.syntax--storage {
    color: @purple;
}

.syntax--constant {
    color: @red;

    &.syntax--character.syntax--escape {
        color: @cyan;
    }

    &.syntax--numeric {
        color: @strong-orange;
    }

    &.syntax--other.syntax--color {
        color: @cyan;
    }

    &.syntax--other.syntax--symbol {
        color: @green;
    }

    &.syntax--language.syntax--null {
        color: @pink;
    }
}

.syntax--variable {
    color: @very-light-gray;

    &.syntax--interpolation {
        color: darken(@red, 10%);
    }

    &.syntax--parameter.syntax--function {
        color: @strong-orange;
    }

    &.syntax--language {
        color: @pink;
    }

    &.syntax--variable {
        &.syntax--object {
            color: @orange;
        }
    }
}

.syntax--invalid.syntax--illegal {
    background-color: @red;
    color: @syntax-background-color;
}

.syntax--string {
    color: @green;

    &.syntax--regexp {
        color: @cyan;

        .syntax--source.syntax--ruby.syntax--embedded {
            color: @orange;
        }
    }

    &.syntax--other.syntax--link {
        color: @red;
    }
}

.syntax--punctuation {
    &.syntax--definition {
        &.syntax--comment {
            color: @syntax-comment-color;
        }

        &.syntax--array,
        &.syntax--parameters,
        &.syntax--string,
        &.syntax--variable {
            color: @syntax-text-color;

            &.syntax--begin, &.syntax--end {
                color: @cyan;
            }
        }

        &.syntax--heading,
        &.syntax--identity {
            color: @blue;
        }

        &.syntax--bold {
            color: @light-orange;
            font-weight: bold;
        }

        &.syntax--italic {
            color: @purple;
            font-style: italic;
        }

        &.syntax--entity {
            color: @cyan;
        }
    }

    &.syntax--section {
        &.syntax--array {
            color: @cyan;
        }

        &.syntax--embedded {
            color: @cyan;
        }
    }

    &.syntax--separator {
        &.syntax--key-value {
            color: @cyan;
        }
    }

    &.syntax--terminator {
        color: @cyan;
    }
}

.syntax--support {
    &.syntax--class {
        color: @orange;
    }

    &.syntax--function {
        color: @blue;

        &.syntax--any-method {
            color: @blue;
        }
    }

    &.syntax--type {
        color: @orange;
    }

    &.syntax--variable {
        &.syntax--dom {
            color: @orange;
        }
    }
}

.syntax--entity {
    &.syntax--name {
        &.syntax--function {
            color: @blue;
        }

        &.syntax--type {
            color: @very-light-gray;
        }
    }

    &.syntax--other {
        &.syntax--inherited-class {
            color: @green;
        }

        &.syntax--attribute-name {
            &.syntax--pseudo-element {
                color: @purple;
            }

            &.syntax--attribute {
                color: @purple;
            }
        }
    }

    &.syntax--name.syntax--class,
    &.syntax--name.syntax--type.syntax--class {
        color: @orange;
    }

    &.syntax--name.syntax--section {
        color: @blue;
    }

    &.syntax--name.syntax--tag {
        color: @red;
    }

    &.syntax--other.syntax--attribute-name {
        color: @orange;
    }
}

.syntax--meta {
    &.syntax--class {
        color: @light-orange;
    }

    &.syntax--delimiter {
        &.syntax--period {
            color: @cyan;
        }
    }

    &.syntax--link {
        color: @orange;
    }

    &.syntax--require {
        color: @blue;
    }

    &.syntax--selector {
        color: @purple;
    }

    &.syntax--separator {
        background-color: @gray;
        color: @syntax-text-color;
    }

    &.syntax--brace {
        &.syntax--round, &.syntax--square {
            color: @cyan;
        }
    }
}

.syntax--none {
    color: @syntax-text-color;
}

.syntax--markup {
    &.syntax--bold {
        color: @orange;
        font-weight: bold;
    }

    &.syntax--changed {
        color: @purple;
    }

    &.syntax--deleted {
        color: @red;
    }

    &.syntax--italic {
        color: @purple;
        font-style: italic;
    }

    &.syntax--heading .syntax--punctuation.syntax--definition.syntax--heading {
        color: @blue;
    }

    &.syntax--inserted {
        color: @green;
    }

    &.syntax--list {
        color: @red;
    }

    &.syntax--quote {
        color: @orange;
    }

    &.syntax--raw.syntax--inline {
        color: @green;
    }
}

.syntax--source.syntax--gfm .syntax--markup {
    -webkit-font-smoothing: auto;

    &.syntax--heading {
        color: @green;
    }
}

// Mini editor
atom-text-editor[mini] .scroll-view {
    padding-left: 1px;
}

// Bracket Matcher
atom-text-editor {
    .highlight .region.bracket-matcher {
        z-index: inherit;
    }
}

.bracket-matcher .region {
    border-bottom: 1px solid @syntax-cursor-color;
    box-sizing: border-box;
    background-color: fade(@syntax-text-color, 10%);
    box-shadow: inset 0 -1px 0 @syntax-cursor-color;
}

// Misspelled word
atom-text-editor .spell-check-misspelling .region {
    z-index: auto;
}
