title |
---|
Docs |
This is the Form.io theme for sf.gov.
The "standalone" JavaScript bundle is intended to be used in a browser (or
browser-like environment) via <script>
tags. You'll need to include the
formiojs library in your document before formio-sfds, like so:
<script src="https://unpkg.com/[email protected]/dist/formio.full.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/formio-sfds.standalone.js"></script>
The CSS in this package provides a suite of styles that target a mix of Form.io-generated selectors and classes used in the custom theme templates, as well as a collection of general-purpose utility classes for tweaking individual elements.
Note: The formio-sfds.standalone.js
bundle injects the CSS into the
<head>
of the host document at runtime, so there's no need for a separate
<link>
tag.
All of the selectors in the packaged CSS are scoped to (nested in) a
.formio-sfds
class selector, which effectively prevents them from leaking
into the page where the form is embedded.
Unless you're using the standalone bundle (which wraps
the form elements automatically), you'll need to wrap all of your the elements
targeted by Formio.createForm()
with a <div class="formio-sfds">
.
The "portal" bundle is intended for use inside the form.io admin UI, and customizes the palette of available components with this theme's components. To use it, visit your form.io project Settings page, and paste the URL below into the "Custom Javascript" (sic) field:
https://unpkg.com/[email protected]/dist/portal.js
License: MIT
-
Open a PR in the formio-sfds repo (may need to add you as a collaborator so that you can open PRs directly and GitHub Actions will publish your changes to npm automatically)
-
In the PR checks, when you click “Show all checks”, you can copy the published version from the “publish formio-sfds” check:
-
Pop that 0.0.0- value into the "Form.io SFDS version" field on /admin/config/services/sfgov_formio in your local and multidev environments (not in the committed settings YAML — we only want to commit published versions)
-
Test your changes and get them reviewed in your multidev
-
Get the changes to formio-sfds approved and released
-
Update config/sfgov_formio.settings.yml by setting formio_sfds_version to the newly published release version (i.e. 9.2.3)
-
Re-test after deploying again to make sure it still works