This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Draft
Conversation
anders-kiaer
commented
Feb 7, 2020
| new MiniCssExtractPlugin({ | ||
| filename: `${dashLibraryName}.css`, | ||
| }), | ||
| //new WebpackDashDynamicImport(), |
Author
There was a problem hiding this comment.
Had to comment this one out temporarily in order to be able to run npm run build, but I guess someone knowing the details of WebpackDashDynamicImport would be able to figure out how to include it again.
Author
|
Did another quick test, with this PR, to check if "inline style logic from Python" works with strict CSS CSP. The result was that it works, as might be expected since Dash probably pass the import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output
from flask_talisman import Talisman
app = dash.Dash(__name__)
CSP = {
"default-src": "'self'",
"script-src": ["'self'", "'sha256-jZlsGVOhUAIcH+4PVs7QuGZkthRMgvT2n0ilH6/zTM0='"],
"style-src": "'self'",
}
Talisman(app.server, content_security_policy=CSP, force_https=False)
app.layout = dcc.RadioItems(
id="radioitems",
options=[{"label": color, "value": color} for color in ["red", "blue", "green"]],
)
@app.callback(
Output("radioitems", "style"), [Input("radioitems", "value")],
)
def _update_style(value):
return {"backgroundColor": value}
if __name__ == "__main__":
app.run_server() |
ab6c61d to
8cc9f10
Compare
8cc9f10 to
ad299f6
Compare
5 tasks
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




This is a draft PR of how
dash-core-componentscould build its static CSS into a separate.cssfile, which then is loaded through Dash's_css_dist.Resolves #752, and enables e.g. running