Skip to content

feat(v2): allow to use array of files in customCss field#3474

Merged
slorber merged 2 commits intofacebook:masterfrom
Simek:theme-classic-allow-customCss-array
Sep 28, 2020
Merged

feat(v2): allow to use array of files in customCss field#3474
slorber merged 2 commits intofacebook:masterfrom
Simek:theme-classic-allow-customCss-array

Conversation

@Simek
Copy link
Contributor

@Simek Simek commented Sep 23, 2020

Motivation

This small PR fixes the issue with server build when array of files was specified in customCss field in the theme classic preset configuration.

CC @slorber

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Successful server build of React Native website with multiple files in customCss.

Related PRs

@Simek Simek requested a review from lex111 as a code owner September 23, 2020 11:04
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 23, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Sep 23, 2020

Deploy preview for docusaurus-2 ready!

Built with commit 44ef7f5

https://deploy-preview-3474--docusaurus-2.netlify.app

@lex111
Copy link
Contributor

lex111 commented Sep 23, 2020

@Simek your PR resolves #3416?

@Simek
Copy link
Contributor Author

Simek commented Sep 23, 2020

@lex111 Yup, this PR should fix the mentioned issue by you too, but I have not added the Joi validator as Sebastien suggested in there.

@lex111
Copy link
Contributor

lex111 commented Sep 23, 2020

@Simek will you do that? Also we need to update the docs.

@Simek
Copy link
Contributor Author

Simek commented Sep 23, 2020

@lex111 I'm not sure how to do this correctly, since customCss field is a part of presets.theme config, not themeConfig (and it's not validated in any way right now).

Also it looks like an additional schema will be needed in docusaurus-utils-validation, but to be honest I'm not that familiar with Joi.

@lex111
Copy link
Contributor

lex111 commented Sep 23, 2020

I'm not very good at this either, alright, so let's wait until Sebastien comes back from vacation.

@anshulrgoyal
Copy link
Contributor

For Joi validation add it in the classic theme option validation.

@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Sep 28, 2020
- fix bug (push instead of concat)
- update docs
- add theme config validation + tests
@Simek Simek requested a review from yangshun as a code owner September 28, 2020 15:59
@slorber
Copy link
Collaborator

slorber commented Sep 28, 2020

Hey, I've added the validation. Also fixed a bug because using concat instead of push was no-op :)

@slorber slorber linked an issue Sep 28, 2020 that may be closed by this pull request
@slorber slorber merged commit ae2c063 into facebook:master Sep 28, 2020
slorber added a commit that referenced this pull request Sep 29, 2020
* feat(v2): allow to use array of files in customCss field

* customCss array:
- fix bug (push instead of concat)
- update docs
- add theme config validation + tests

Co-authored-by: slorber <lorber.sebastien@gmail.com>
@lex111 lex111 added this to the v2.0.0-alpha.65 milestone Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSS support - being able to call an array of CSS files in the config

6 participants