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

added automatic detection of css files #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions {{cookiecutter.project_shortname}}/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include {{cookiecutter.project_shortname}}/*-shared.js
include {{cookiecutter.project_shortname}}/*-shared.js.map
include {{cookiecutter.project_shortname}}/metadata.json
include {{cookiecutter.project_shortname}}/package-info.json
recursive-include {{cookiecutter.project_shortname}} *.css
include README.md
include LICENSE
include package.json
2 changes: 0 additions & 2 deletions {{cookiecutter.project_shortname}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ If you have selected install_dependencies during the prompt, you can skip this p
- Run the tests with `$ pytest tests`.
- The Dash team uses these types of integration tests extensively. Browse the Dash component code on GitHub for more examples of testing (e.g. https://github.com/plotly/dash-core-components)
- Add custom styles to your component by putting your custom CSS files into your distribution folder (`{{cookiecutter.project_shortname}}`).
- Make sure that they are referenced in `MANIFEST.in` so that they get properly included when you're ready to publish your component.
- Make sure the stylesheets are added to the `_css_dist` dict in `{{cookiecutter.project_shortname}}/__init__.py` so dash will serve them automatically when the component suite is requested.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This info might come in handy:

  • styles from the distribution folder are automatically referenced in 'MANIFEST.in' and the _css_dist dictionary in {{cookiecutter.project_shortname}}/init.py. If a custom reference is needed, make an analogous reference.

- [Review your code](./review_checklist.md)

### Create a production build and publish:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@
]
)

_css_dist = []
_css_dist = [
{
'relative_package_path': _os.path.relpath(_os.path.join(dirpath, filename), _basepath),
'namespace': package_name
} for dirpath, dirnames, filenames in _os.walk(_basepath) for filename in filenames if filename.endswith('.css')
]


for _component in __all__:
Expand Down