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

Update scoped styles documentation in guides #11311

Merged
merged 4 commits into from
Mar 28, 2025

Conversation

dominik-ilja
Copy link
Contributor

Description (required)

Previous docs state that scoped styles don't increase specificity which is inaccurate. Scoped styles will increase class specificity by 1.

The imported style in the second example will have a specificity of 0-0-2. This will not override the scoped style of 0-1-1. The example is updated to use an ID selector which will override the scoped style with its specificity of 1-0-0.

Previous docs state that scoped styles don't increase specificity which is inaccurate. Scoped styles will increase class specificity by 1.

The imported style in the second example will have a specificity of 0-0-2. This will not override the scoped style of 0-1-1. The example is updated to use an ID selector which will override the scoped style with its specificity of 1-0-0.
Copy link

netlify bot commented Mar 27, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d8fdfe5
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/67e68c3565b60d000840d208
😎 Deploy Preview https://deploy-preview-11311--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Mar 27, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/styling.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@astrobot-houston
Copy link
Contributor

Hello! Thank you for opening your first PR to Astro’s Docs! 🎉

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any broken links you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Netlify 🥳.

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Thanks for bringing this to our attention, @dominik-ilja ! You're right, our wording was from before we updated the default styleScopingStrategy from where to attribute.

I've made some suggestions below, because it's not really correct to say "scoped styles do/don't increase specificity" because it depends what the user has configured. So instead, I think the wording below prompts people to the config value which has explanations of each mode, and when specificity does or doesn't increase with scoped styling. See if you think something like those changes work!

@sarah11918 sarah11918 added the improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) label Mar 27, 2025
@dominik-ilja
Copy link
Contributor Author

Hey! I went ahead and made those changes. I was originally unaware that you could configure the scoped styles. Thank you for bringing that up.

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Thank you again for this super helpful contribution, @dominik-ilja , and welcome to Team Docs! 🥳

@sarah11918 sarah11918 merged commit 9ff9a84 into withastro:main Mar 28, 2025
10 checks passed
ArmandPhilippot added a commit to ArmandPhilippot/astro-docs that referenced this pull request Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants