Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby-plugin-sass): fix brand name, code block around names #28908

Merged
merged 2 commits into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-sass/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

### Features

- **gatsby-plugin-sass:** Support Dart SASS ([#10159](https://github.com/gatsbyjs/gatsby/issues/10159)) ([a48843e](https://github.com/gatsbyjs/gatsby/commit/a48843e))
- **gatsby-plugin-sass:** Support Dart Sass ([#10159](https://github.com/gatsbyjs/gatsby/issues/10159)) ([a48843e](https://github.com/gatsbyjs/gatsby/commit/a48843e))

<a name="2.0.6"></a>

Expand Down
14 changes: 7 additions & 7 deletions packages/gatsby-plugin-sass/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import "./src/index.scss"

## Other options

If you need to pass options to Sass use the plugins options, see [node-sass](https://github.com/sass/node-sass)/[dart-sass](https://github.com/sass/dart-sass) docs
If you need to pass options to Sass use the plugins options, see [`node-sass`](https://github.com/sass/node-sass)/[`dart-sass`](https://github.com/sass/dart-sass) docs
for all available options.

```javascript:title=gatsby-config.js
Expand Down Expand Up @@ -128,7 +128,7 @@ plugins: [
Using CSS Modules requires no additional configuration. Simply prepend `.module` to the extension. For example: `App.scss` -> `App.module.scss`.
Any file with the `module` extension will use CSS Modules.

## SASS & CSS Modules file Regexes
## Sass & CSS Modules file Regexes

To override the file regex for Sass or CSS modules,

Expand All @@ -137,7 +137,7 @@ plugins: [
{
resolve: `gatsby-plugin-sass`,
options: {
// Override the file regex for SASS
// Override the file regex for Sass
sassRuleTest: /\.global\.s(a|c)ss$/,
// Override the file regex for CSS modules
sassRuleModulesTest: /\.mod\.s(a|c)ss$/,
Expand All @@ -155,9 +155,9 @@ in the plugin options.

## Relative paths & `url()`

This plugin resolves `url()` paths relative to the entry SCSS/Sass file not – as might be expected – the location relative to the declaration. Under the hood, it makes use of [sass-loader](https://github.com/webpack-contrib/sass-loader/blob/master/README.md#problems-with-url) and this is documented in the [readme](https://github.com/webpack-contrib/sass-loader/blob/master/README.md#problems-with-url).
This plugin resolves `url()` paths relative to the entry SCSS/Sass file not – as might be expected – the location relative to the declaration. Under the hood, it makes use of [`sass-loader`](https://github.com/webpack-contrib/sass-loader/blob/master/README.md#problems-with-url) and this is documented in the [readme](https://github.com/webpack-contrib/sass-loader/blob/master/README.md#problems-with-url).

Using [resolve-url-loader](https://github.com/bholloway/resolve-url-loader) provides a workaround, if you want to use relative url just install the plugin and then add it to your sass plugin options configuration.
Using [`resolve-url-loader`](https://github.com/bholloway/resolve-url-loader) provides a workaround, if you want to use relative url just install the plugin and then add it to your Sass plugin options configuration.

First:

Expand All @@ -178,7 +178,7 @@ plugins: [
]
```

You can also configure resolve-url-plugin providing some options (see [plugin documentation](https://github.com/bholloway/resolve-url-loader) for all options):
You can also configure `resolve-url-plugin` providing some options (see [plugin documentation](https://github.com/bholloway/resolve-url-loader) for all options):

```javascript:title=gatsby-config.js
plugins: [
Expand All @@ -195,7 +195,7 @@ plugins: [
]
```

**Please note:** Adding resolve-url-loader will use `sourceMap: true` on sass-loader (as it is required for the plugin to work), you can then activate/deactivate source-map for Sass files in the plugin:
**Please note:** Adding `resolve-url-loader` will use `sourceMap: true` on `sass-loader` (as it is required for the plugin to work), you can then activate/deactivate source-map for Sass files in the plugin:

```javascript:title=gatsby-config.js
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-sass/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gatsby-plugin-sass",
"description": "Gatsby plugin to handle scss/sass files",
"description": "Gatsby plugin to handle SCSS/Sass files",
"version": "3.1.0-next.0",
"author": "Daniel Farrell <[email protected]>",
"bugs": {
Expand Down
8 changes: 4 additions & 4 deletions packages/gatsby-plugin-sass/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,17 @@ exports.pluginOptionsSchema = function ({ Joi }) {
.description(`An array of postCss plugins`),
sassRuleTest: Joi.object()
.instance(RegExp)
.description(`Override the file regex for SASS`),
.description(`Override the file regex for Sass`),
sassRuleModulesTest: Joi.object()
.instance(RegExp)
.description(`Override the file regex for SASS`),
.description(`Override the file regex for Sass`),
useResolveUrlLoader: Joi.alternatives().try(
Joi.boolean(),
Joi.object({}).unknown(true)
)
.description(`This plugin resolves url() paths relative to the entry SCSS/Sass file not – as might be expected – the location relative to the declaration. Under the hood, it makes use of sass-loader and this is documented in the readme.

Using resolve-url-loader provides a workaround, if you want to use relative url just install the plugin and then add it to your sass plugin options configuration.`),
Using resolve-url-loader provides a workaround, if you want to use relative url just install the plugin and then add it to your Sass plugin options configuration.`),
// TODO: Use alternatives() to also allow function. Currently some bug in our schema validation (test)
sassOptions: Joi.object({
file: Joi.string()
Expand All @@ -129,7 +129,7 @@ exports.pluginOptionsSchema = function ({ Joi }) {
functions: Joi.object()
.pattern(MATCH_ALL_KEYS, Joi.function().maxArity(2))
.description(
`functions is an Object that holds a collection of custom functions that may be invoked by the sass files being compiled.`
`functions is an Object that holds a collection of custom functions that may be invoked by the Sass files being compiled.`
),
includePaths: Joi.array()
.items(Joi.string())
Expand Down