Skip to content

How to bundle css/elementary-flow.css? #2

Description

@Lucca-mito

First, thank you @sliemeobn for creating ElementaryUI and ElementaryFlow. The framework is truly incredible already, and I'm excited to follow its development.

I’m working on a project using ElementaryUI and -Flow for its web front-end. I’m able to build and serve the web app, and the .styles defined in the code are loaded (a .background(.black) I defined shows up as --e-bg: black in the CSS inspector). But the styles are not actually applied, suggesting that whatever stylesheet defines ElementaryFlow’s CSS variables (such as --e-bg) is not loaded.

ElementaryFlow’s How to Use It explains that

The package contains a single, static CSS file that must be loaded for ElementaryFlow to work: css/elementary-flow.css. Make sure to bundle this file as part of your web project build.

So I imagine the issue is that I’m not bundling css/elementary-flow.css. So, how exactly should this file be bundled?

The Swiftle sample app bundles it by setting resolve.alias["ElementaryFlow"] to resolve(__dirname, ".build/checkouts/elementary-flow/css/elementary-flow.css"). So I added node:path as a dev dependency, followed the resolve+__dirname approach, rebuilt, and re-served, but no stylesheet.

WasmExample bundles the file by using explicit relative paths for resolve.alias["ElementaryFlow"] instead (in its case, "../../css/elementary-flow.css"), and I see that other ElementaryFlow-provided .build resources (namely .build/checkouts/elementary-ui/BrowserRuntime) are bundled in the starter project and in all sample apps via a different approach entirely (by adding them to the "dependencies" in package.json).

So, what is the right way to bundle the ElementaryFlow stylesheet? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions