Skip to content

Commit adf0ba0

Browse files
dimaMachinaTallTed
andauthored
use hsl instead hsla when alpha is 1 (#3634)
* prefer `hsl` * add changeset * Update .changeset/fair-cups-cry.md Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com> * Update packages/graphiql-react/src/ui/markdown.css Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com> --------- Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
1 parent b52c391 commit adf0ba0

File tree

20 files changed

+58
-52
lines changed

20 files changed

+58
-52
lines changed

Diff for: .changeset/fair-cups-cry.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'graphiql': patch
3+
'@graphiql/plugin-code-exporter': patch
4+
'@graphiql/react': patch
5+
---
6+
7+
when alpha is `1`, use `hsl` instead of `hsla`

Diff for: examples/graphiql-webpack/src/index.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ li.select-server--previous-entry button:hover {
9797

9898
li.select-server--previous-entry button {
9999
background-color: transparent;
100-
border: hsla(var(--color-neutral), 1);
100+
border: hsl(var(--color-neutral));
101101
display: flex;
102-
color: hsla(var(--color-neutral), 1);
102+
color: hsl(var(--color-neutral));
103103
font-size: 1rem;
104-
cursor: pinter;
104+
cursor: pointer;
105105
padding: 0.5rem;
106106
}

Diff for: examples/graphiql-webpack/src/select-server-plugin.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ li.select-server--previous-entry button:hover {
9696

9797
li.select-server--previous-entry button {
9898
background-color: transparent;
99-
border: hsla(var(--color-neutral), 1);
99+
border: hsl(var(--color-neutral));
100100
display: flex;
101-
color: hsla(var(--color-neutral), 1);
101+
color: hsl(var(--color-neutral));
102102
font-size: 1rem;
103-
cursor: pinter;
103+
cursor: pointer;
104104
padding: 0.5rem;
105105
}

Diff for: packages/cm6-graphql/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ autocomplete and linting powered by your GraphQL Schema.
1111
### Getting Started
1212

1313
```sh
14-
npm install --save cm6-graphql
14+
npm install cm6-graphql
1515
```
1616

1717
[CodeMirror 6](https://codemirror.net/) customization is done through

Diff for: packages/codemirror-graphql/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ typeahead hinter powered by your GraphQL Schema.
1515
### Getting Started
1616

1717
```sh
18-
npm install --save codemirror-graphql
18+
npm install codemirror-graphql
1919
```
2020

2121
CodeMirror helpers install themselves to the global CodeMirror when they are

Diff for: packages/graphiql-plugin-code-exporter/README.md

+10-11
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ into the GraphiQL UI.
99
Use your favorite package manager to install the package:
1010

1111
```sh
12-
npm i -S @graphiql/plugin-code-exporter
12+
npm install @graphiql/plugin-code-exporter
1313
```
1414

1515
The following packages are peer dependencies, so make sure you have them
1616
installed as well:
1717

1818
```sh
19-
npm i -S react react-dom graphql
19+
npm install react react-dom graphql
2020
```
2121

2222
## Usage
@@ -27,22 +27,21 @@ for all details on available `props` and how to
2727
[create snippets](https://github.com/OneGraph/graphiql-code-exporter#snippets).
2828

2929
```jsx
30-
import { codeExporterPlugin } from '@graphiql/plugin-code-exporter';
31-
import { createGraphiQLFetcher } from '@graphiql/toolkit';
32-
import { GraphiQL } from 'graphiql';
3330
import { useState } from 'react';
34-
31+
import { GraphiQL } from 'graphiql';
32+
import { createGraphiQLFetcher } from '@graphiql/toolkit';
33+
import { codeExporterPlugin } from '@graphiql/plugin-code-exporter';
3534
import 'graphiql/graphiql.css';
3635
import '@graphiql/plugin-code-exporter/dist/style.css';
3736

3837
const fetcher = createGraphiQLFetcher({
3938
url: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
4039
});
4140

42-
/*
43-
Example code for snippets. See https://github.com/OneGraph/graphiql-code-exporter#snippets for details
44-
*/
45-
41+
/**
42+
* Example code for snippets. See https://github.com/OneGraph/graphiql-code-exporter#snippets for
43+
* details
44+
*/
4645
const removeQueryName = query =>
4746
query.replace(
4847
/^[^{(]+([{(])/,
@@ -91,7 +90,7 @@ const exporter = codeExporterPlugin({
9190
codeMirrorTheme: 'graphiql',
9291
});
9392

94-
function GraphiQLWithExplorer() {
93+
function GraphiQLWithCodeExporter() {
9594
return (
9695
<GraphiQL fetcher={fetcher} defaultQuery={query} plugins={[exporter]} />
9796
);

Diff for: packages/graphiql-plugin-code-exporter/examples/index.html

+8-8
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676
}
7777

7878
var exampleSnippetOne = {
79-
name: `Example One`,
80-
language: `JavaScript`,
81-
codeMirrorMode: `jsx`,
79+
name: 'Example One',
80+
language: 'JavaScript',
81+
codeMirrorMode: 'jsx',
8282
options: [],
8383
generate: arg => `export const query = graphql\`
8484
${getQuery(arg, 2)}
@@ -87,9 +87,9 @@
8787
};
8888

8989
var exampleSnippetTwo = {
90-
name: `Example Two`,
91-
language: `JavaScript`,
92-
codeMirrorMode: `jsx`,
90+
name: 'Example Two',
91+
language: 'JavaScript',
92+
codeMirrorMode: 'jsx',
9393
options: [],
9494
generate: arg => `import { graphql } from 'graphql'
9595
@@ -107,7 +107,7 @@
107107
var query =
108108
'query AllFilms {\n allFilms {\n films {\n title\n }\n }\n}';
109109

110-
function GraphiQLWithExporter() {
110+
function GraphiQLWithCodeExporter() {
111111
return React.createElement(GraphiQL, {
112112
fetcher: fetcher,
113113
defaultEditorToolsVisibility: true,
@@ -117,7 +117,7 @@
117117
}
118118

119119
const root = ReactDOM.createRoot(document.getElementById('graphiql'));
120-
root.render(React.createElement(GraphiQLWithExporter));
120+
root.render(React.createElement(GraphiQLWithCodeExporter));
121121
</script>
122122
</body>
123123
</html>

Diff for: packages/graphiql-plugin-code-exporter/src/index.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
cursor: pointer;
8383
text-decoration: none;
8484
padding: var(--px-8) var(--px-12);
85-
color: hsla(var(--color-neutral), 1) !important;
85+
color: hsl(var(--color-neutral)) !important;
8686
border-radius: var(--border-radius-4) !important;
8787
&:hover {
8888
background-color: hsla(

Diff for: packages/graphiql-react/src/editor/style/info.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
border: var(--popover-border);
55
border-radius: var(--border-radius-8);
66
box-shadow: var(--popover-box-shadow);
7-
color: hsla(var(--color-neutral), 1);
7+
color: hsl(var(--color-neutral));
88
max-height: 300px;
99
max-width: 400px;
1010
opacity: 0;

Diff for: packages/graphiql-react/src/explorer/components/search.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
border: var(--popover-border);
66
border-radius: var(--border-radius-4);
77
box-shadow: var(--popover-box-shadow);
8-
color: hsla(var(--color-neutral), 1);
8+
color: hsl(var(--color-neutral));
99

1010
& .graphiql-doc-explorer-search-input {
1111
background: hsl(var(--color-base));

Diff for: packages/graphiql-react/src/history/style.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
height: 34px;
2727

2828
&:hover {
29-
color: hsla(var(--color-neutral), 1);
29+
color: hsl(var(--color-neutral));
3030
background-color: hsla(var(--color-neutral), var(--alpha-background-light));
3131
}
3232

@@ -91,7 +91,7 @@ button.graphiql-history-item-action {
9191
padding: var(--px-8) var(--px-6);
9292

9393
&:hover {
94-
color: hsla(var(--color-neutral), 1);
94+
color: hsl(var(--color-neutral));
9595
}
9696

9797
& > svg {

Diff for: packages/graphiql-react/src/icons/close.svg

+3-3
Loading

Diff for: packages/graphiql-react/src/icons/plus.svg

+2-2
Loading

Diff for: packages/graphiql-react/src/style/root.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ body.graphiql-dark [data-radix-popper-content-wrapper] {
121121
.graphiql-dialog {
122122
&,
123123
&:is(button) {
124-
color: hsla(var(--color-neutral), 1);
124+
color: hsl(var(--color-neutral));
125125
font-family: var(--font-family);
126126
font-size: var(--font-size-body);
127-
font-weight: var(----font-weight-regular);
127+
font-weight: var(--font-weight-regular);
128128
line-height: var(--line-height);
129129
}
130130

131131
& input {
132-
color: hsla(var(--color-neutral), 1);
132+
color: hsl(var(--color-neutral));
133133
font-family: var(--font-family);
134134
font-size: var(--font-size-caption);
135135

Diff for: packages/graphiql-react/src/ui/button.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ button.graphiql-button {
2525
background-color: hsla(var(--color-neutral), var(--alpha-background-light));
2626
border: none;
2727
border-radius: var(--border-radius-4);
28-
color: hsla(var(--color-neutral), 1);
28+
color: hsl(var(--color-neutral));
2929
cursor: pointer;
3030
font-size: var(--font-size-body);
3131
padding: var(--px-8) var(--px-12);

Diff for: packages/graphiql-react/src/ui/markdown.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* We render markdown in the following places:
3-
* - In the hint tooltip when typing in the query editor (field description
4-
* and optionally deprecation reason).
3+
* - In the hint tooltip when typing in the query editor (field description
4+
* and, optionally, deprecation reason).
55
* - In the info tooltip when hovering over a field in the query editor
6-
* (field description any optionally deprecation reason).
6+
* (field description and, optionally, deprecation reason).
77
*/
88

99
.graphiql-markdown-description,
@@ -87,7 +87,7 @@
8787
& code,
8888
& pre {
8989
background-color: hsla(var(--color-neutral), var(--alpha-background-light));
90-
color: hsla(var(--color-neutral), 1);
90+
color: hsl(var(--color-neutral));
9191
}
9292

9393
& > * {

Diff for: packages/graphiql-toolkit/docs/create-fetcher.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ specification, and the most popular transport spec proposals.
1515
You can install `@graphiql/toolkit` using your favorite package manager:
1616

1717
```bash
18-
npm install --save @graphiql/toolkit
18+
npm install @graphiql/toolkit
1919
```
2020

2121
## Getting Started
@@ -50,7 +50,7 @@ root.render(<App />);
5050
First you'll need to install `graphql-ws` as a peer dependency:
5151

5252
```bash
53-
npm install --save graphql-ws
53+
npm install graphql-ws
5454
```
5555

5656
Just by providing the `subscriptionUrl`, you can also generate a `graphql-ws`
@@ -193,7 +193,7 @@ root.render(<App />);
193193
Note that you will need to install the client separately:
194194

195195
```bash
196-
npm install --save subscriptions-transport-ws
196+
npm install subscriptions-transport-ws
197197
```
198198

199199
### Custom `fetcher` Example

Diff for: packages/graphiql/src/style.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434

3535
.graphiql-container .graphiql-sidebar button.active {
36-
color: hsla(var(--color-neutral), 1);
36+
color: hsl(var(--color-neutral));
3737
}
3838

3939
.graphiql-container .graphiql-sidebar button:not(:first-child) {
@@ -169,7 +169,7 @@ button.graphiql-tab-add > svg {
169169
}
170170

171171
.graphiql-container .graphiql-editor-tools button.active {
172-
color: hsla(var(--color-neutral), 1);
172+
color: hsl(var(--color-neutral));
173173
}
174174

175175
/* The tab buttons to switch between editor tools */

Diff for: packages/graphql-language-service-cli/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ yarn global add graphql-language-service-cli
5353
with `npm`:
5454

5555
```sh
56-
npm i -g graphql-language-service-cli
56+
npm install -g graphql-language-service-cli
5757
```
5858

5959
either will install the `graphql-lsp` bin globally

Diff for: packages/graphql-language-service-server/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Supported features include:
4242
### Installation
4343

4444
```bash
45-
npm install --save graphql-language-service-server
45+
npm install graphql-language-service-server
4646
# or
4747
yarn add graphql-language-service-server
4848
```

0 commit comments

Comments
 (0)