-
Notifications
You must be signed in to change notification settings - Fork 60
Improved theme settings support #402
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
Improved theme settings support #402
Conversation
…-support Conflicts: src/styles/core/_vars.scss
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work Marcus, just a few questions:
- Would we keep the old
--colors
vs--color
naming convention? I think--colors
used to come from the initial version of the theme-settings? Or are we just deprecating that for now, without removing support?
From an API point of view, I think it should be considered unofficially deprecated. Since none of the implementation for it has been changed, things should continue to work if the plural form is used in the cases where it was previously being used, although ideally those clients using the old form could very simply adopt to the new version. Going forward, I think the singular form would be documented as the correct API. (I went with that version only because it has a 1-1 correlation with the actual CSS property names.) |
I've opened a PR on DocC that adds an API reference for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Marcus, this is a great improvement in the way we customise our UI 👏
…-support Conflicts: src/components/Icons/SwiftFileIcon.vue
@swift-ci test |
1 similar comment
@swift-ci test |
There is code in the function to lock the scroll which adds inline styles to the body element. These styles are removed by clearing out all the inline styles when the unlock function is called—but also any inline styles are removed which interferes with the theme settings variables—by being more explicit about which inline styles are removed, this bug can be avoided. Now, only those styles needed for locking/unlocking scroll are removed when that function is called.
Conflicts: src/components/SVGIcon.vue
@swift-ci test |
Bug/issue #, if applicable: 97040358
Summary
This PR updates the existing support for the
theme-settings.json
file to be more fully featured and capable. This is the Swift-DocC-Render implementation support for my recent forum proposal titledCustomizing the look and feel of Swift-DocC-Render.
Major Changes:
theme-settings.json
file since it only existed for pseudo documentation purposes (full OpenAPI spec will be created for Swift-DocC as well as conceptual docs)theme-settings.json
file should be specified here (will open PR on Swift-DocC for this soon)More documentation PRs will be created for the swift-docc repo next to guide users on how to utilize this file.
Dependencies
swiftlang/swift-docc#339 (already merged to Swift-DocC main)
Testing
Steps:
npm run build
to build this branch of swift-docc-rendertheme-settings.json
file and customarticle.svg
icon from files.zip and copy them into the top level of the documentation catalog for SwiftDocC atSources/SwiftDocC/SwiftDocC.docc
env DOCC_HTML_DIR=/path/to/swift-docc-render/dist bin/preview-docs SwiftDocC
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
npm test
, and it succeeded