Skip to content

Commit

Permalink
rename CSS variables for colors (#2641)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheyenbrock committed Aug 9, 2022
1 parent b7b81f8 commit 7e8db9e
Show file tree
Hide file tree
Showing 21 changed files with 92 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

15%,
85% {
background-color: hsla(var(--color-orche), 0.07);
background-color: hsla(var(--color-warning), 0.07);
}
}
30 changes: 15 additions & 15 deletions packages/graphiql-react/src/editor/style/codemirror.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,55 +39,55 @@

/* OperationType, `fragment`, `on` */
& .cm-keyword {
color: hsl(var(--color-pink));
color: hsl(var(--color-primary));
}
/* Name (OperationDefinition), FragmentName */
& .cm-def {
color: hsl(var(--color-teal));
color: hsl(var(--color-tertiary));
}
/* Punctuator (except `$` and `@`) */
& .cm-punctuation {
color: hsla(var(--color-neutral), 0.6);
}
/* Variable */
& .cm-variable {
color: hsl(var(--color-purple));
color: hsl(var(--color-secondary));
}
/* NamedType */
& .cm-atom {
color: hsl(var(--color-teal));
color: hsl(var(--color-tertiary));
}
/* IntValue, FloatValue */
& .cm-number {
color: hsl(var(--color-green));
color: hsl(var(--color-success));
}
/* StringValue */
& .cm-string {
color: hsl(var(--color-orche));
color: hsl(var(--color-warning));
}
/* BooleanValue */
& .cm-builtin {
color: hsl(var(--color-green));
color: hsl(var(--color-success));
}
/* EnumValue */
& .cm-string-2 {
color: hsl(var(--color-purple));
color: hsl(var(--color-secondary));
}
/* Name (ObjectField, Argument) */
& .cm-attribute {
color: hsl(var(--color-blue));
color: hsl(var(--color-info));
}
/* Name (Directive) */
& .cm-meta {
color: hsl(var(--color-teal));
color: hsl(var(--color-tertiary));
}
/* Name (Alias, Field without Alias) */
& .cm-property {
color: hsl(var(--color-blue));
color: hsl(var(--color-info));
}
/* Name (Field with Alias) */
& .cm-qualifier {
color: hsl(var(--color-purple));
color: hsl(var(--color-secondary));
}
/* Comment */
& .cm-comment {
Expand All @@ -99,7 +99,7 @@
}
/* Invalid characters */
& .cm-invalidchar {
color: hsl(var(--color-red));
color: hsl(var(--color-error));
}

/* Cursor */
Expand Down Expand Up @@ -159,12 +159,12 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {
padding: var(--px-4);
}
.CodeMirror-dialog input:focus {
outline: hsl(var(--color-pink)) solid 2px;
outline: hsl(var(--color-primary)) solid 2px;
}

/* Set the highlight color for search results */
.cm-searching {
background-color: hsla(var(--color-orche), 0.07);
background-color: hsla(var(--color-warning), 0.07);
/**
* When cycling through search results, CodeMirror overlays the current
* selection with another element that has the .CodeMirror-selected class
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-react/src/editor/style/fold.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}

.CodeMirror-foldmarker {
background-color: hsl(var(--color-blue));
background-color: hsl(var(--color-info));
border-radius: var(--border-radius-4);
color: hsl(var(--color-base));
font-family: inherit;
Expand Down
4 changes: 2 additions & 2 deletions packages/graphiql-react/src/editor/style/hint.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
}
}
li.CodeMirror-hint-active {
background: hsla(var(--color-pink), 0.1);
color: hsl(var(--color-pink));
background: hsla(var(--color-primary), 0.1);
color: hsl(var(--color-primary));
}

/* Sidebar with additional information */
Expand Down
24 changes: 12 additions & 12 deletions packages/graphiql-react/src/editor/style/lint.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,60 @@
background-position: 0 95%;
}
.cm-s-graphiql .CodeMirror-lint-mark-error {
color: hsl(var(--color-red));
color: hsl(var(--color-error));
}
.CodeMirror-lint-mark-error {
background-image: linear-gradient(
45deg,
transparent 65%,
hsl(var(--color-red)) 80%,
hsl(var(--color-error)) 80%,
transparent 90%
),
linear-gradient(
135deg,
transparent 5%,
hsl(var(--color-red)) 15%,
hsl(var(--color-error)) 15%,
transparent 25%
),
linear-gradient(
135deg,
transparent 45%,
hsl(var(--color-red)) 55%,
hsl(var(--color-error)) 55%,
transparent 65%
),
linear-gradient(
45deg,
transparent 25%,
hsl(var(--color-red)) 35%,
hsl(var(--color-error)) 35%,
transparent 50%
);
}
.cm-s-graphiql .CodeMirror-lint-mark-warning {
color: hsl(var(--color-orche));
color: hsl(var(--color-warning));
}
.CodeMirror-lint-mark-warning {
background-image: linear-gradient(
45deg,
transparent 65%,
hsl(var(--color-orche)) 80%,
hsl(var(--color-warning)) 80%,
transparent 90%
),
linear-gradient(
135deg,
transparent 5%,
hsl(var(--color-orche)) 15%,
hsl(var(--color-warning)) 15%,
transparent 25%
),
linear-gradient(
135deg,
transparent 45%,
hsl(var(--color-orche)) 55%,
hsl(var(--color-warning)) 55%,
transparent 65%
),
linear-gradient(
45deg,
transparent 25%,
hsl(var(--color-orche)) 35%,
hsl(var(--color-warning)) 35%,
transparent 50%
);
}
Expand All @@ -88,8 +88,8 @@
padding: 0;
}
.CodeMirror-lint-message-error {
color: hsl(var(--color-red));
color: hsl(var(--color-error));
}
.CodeMirror-lint-message-warning {
color: hsl(var(--color-orche));
color: hsl(var(--color-warning));
}
8 changes: 4 additions & 4 deletions packages/graphiql-react/src/explorer/components/argument.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
}

.graphiql-doc-explorer-argument-name {
color: hsl(var(--color-purple));
color: hsl(var(--color-secondary));
}

.graphiql-doc-explorer-argument-deprecation {
background-color: hsla(var(--color-orche), 0.07);
border: 1px solid hsl(var(--color-orche));
background-color: hsla(var(--color-warning), 0.07);
border: 1px solid hsl(var(--color-warning));
border-radius: var(--border-radius-4);
color: hsl(var(--color-orche));
color: hsl(var(--color-warning));
padding: var(--px-8);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.graphiql-doc-explorer-default-value {
color: hsl(var(--color-green));
color: hsl(var(--color-success));
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.graphiql-doc-explorer-deprecation {
background-color: hsla(var(--color-orche), 0.07);
border: 1px solid hsl(var(--color-orche));
background-color: hsla(var(--color-warning), 0.07);
border: 1px solid hsl(var(--color-warning));
border-radius: var(--px-4);
color: hsl(var(--color-orche));
color: hsl(var(--color-warning));
padding: var(--px-8);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.graphiql-doc-explorer-directive {
color: hsl(var(--color-purple));
color: hsl(var(--color-secondary));
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ a.graphiql-doc-explorer-back {

/* Error message */
.graphiql-doc-explorer-error {
background-color: hsla(var(--color-red), 0.15);
border: 1px solid hsl(var(--color-red));
background-color: hsla(var(--color-error), 0.15);
border: 1px solid hsl(var(--color-error));
border-radius: var(--border-radius-8);
color: hsl(var(--color-red));
color: hsl(var(--color-error));
padding: var(--px-8) var(--px-12);
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
a.graphiql-doc-explorer-field-name {
color: hsl(var(--color-blue));
color: hsl(var(--color-info));
text-decoration: none;

&:hover {
text-decoration: underline;
}

&:focus {
outline: hsl(var(--color-blue)) auto 1px;
outline: hsl(var(--color-info)) auto 1px;
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.graphiql-doc-explorer-root-type {
color: hsl(var(--color-blue));
color: hsl(var(--color-info));
}
6 changes: 3 additions & 3 deletions packages/graphiql-react/src/explorer/components/search.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@
}

.graphiql-doc-explorer-search-type {
color: hsl(var(--color-blue));
color: hsl(var(--color-info));
}

.graphiql-doc-explorer-search-field {
color: hsl(var(--color-orche));
color: hsl(var(--color-warning));
}

.graphiql-doc-explorer-search-argument {
color: hsl(var(--color-purple));
color: hsl(var(--color-secondary));
}

.graphiql-doc-explorer-search-divider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
}

.graphiql-doc-explorer-enum-value {
color: hsl(var(--color-blue));
color: hsl(var(--color-info));
}
4 changes: 2 additions & 2 deletions packages/graphiql-react/src/explorer/components/type-link.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
a.graphiql-doc-explorer-type-name {
color: hsl(var(--color-orche));
color: hsl(var(--color-warning));
text-decoration: none;

&:hover {
text-decoration: underline;
}

&:focus {
outline: hsl(var(--color-orche)) auto 1px;
outline: hsl(var(--color-warning)) auto 1px;
}
}
8 changes: 4 additions & 4 deletions packages/graphiql-react/src/history/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

&.editable {
background-color: hsla(var(--color-pink), 0.1);
background-color: hsla(var(--color-primary), 0.1);

& > input {
background: transparent;
Expand All @@ -43,15 +43,15 @@
}

& > button {
color: hsl(var(--color-pink));
color: hsl(var(--color-primary));
padding: 0 var(--px-10);

&:active {
background-color: hsla(var(--color-pink), 0.15);
background-color: hsla(var(--color-primary), 0.15);
}

&:focus {
outline: hsl(var(--color-pink)) auto 1px;
outline: hsl(var(--color-primary)) auto 1px;
}

& > svg {
Expand Down
Loading

0 comments on commit 7e8db9e

Please sign in to comment.