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

docs: update component styling docs #1553

Merged
merged 5 commits into from
Sep 30, 2024
Merged

Conversation

nmerget
Copy link
Contributor

@nmerget nmerget commented Sep 6, 2024

Description

Please provide the following information:

closes #1250

Add some additional explanation for styling Mitosis components

Make sure to follow the PR preparation steps in CONTRIBUTING.md before submitting your PR:

  • format the codebase: from the root, run yarn fmt:prettier.
  • update all snapshots (in core & CLI): from the root, run yarn test:update
  • add Changeset entry: from the root, run yarn g:changeset and follow the CLI instructions. Alternatively, use the Changeset Github Bot to create the file.

Copy link

changeset-bot bot commented Sep 6, 2024

⚠️ No Changeset found

Latest commit: ed6788c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

nx-cloud bot commented Sep 6, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit ed6788c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 4 targets

Sent with 💌 from NxCloud.

@nmerget
Copy link
Contributor Author

nmerget commented Sep 6, 2024

@samijaber Shall I update the changeset here as well? I just updated the docs :/

Comment on lines 201 to 215
### `standalone components`

You should consider developing your components without a fixed style inside the Mitosis component.
Loading the style inside the consuming app via bundler (vite, webpack, etc.) or with default `<link rel="stylesheet" ...`,
enables a flexible approach. You would use `class` or `data-*` attributes inside your Mitosis component:

```tsx
/* ./src/my-component/my-component.lite.tsx */
export default function CSSExample() {
return <div class="my-component" />;
}
```

The advantage of this is, that you can rely on the CSS ecosystem (sass, less, etc.).
But you might encounter some problems when you want to use web-components with shadowDOM.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't fully understand this note. What's a "standalone component"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I meant headless, I don't know why I wrote standalone in the first place.

Changed it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see! Thanks.

I cleaned up the grammar a bit 👍🏽

@samijaber samijaber merged commit 458e837 into BuilderIO:main Sep 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Readme need more info about using CSS
2 participants