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

Document @forward #368

Merged
merged 2 commits into from
Sep 6, 2019
Merged

Document @forward #368

merged 2 commits into from
Sep 6, 2019

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Sep 5, 2019

Closes #362

@nex3 nex3 requested review from Awjin and jelbourn September 5, 2019 21:59
@nex3 nex3 temporarily deployed to sass-lang-pr-368 September 5, 2019 21:59 Inactive
[variables](../variables) from another Sass stylesheet available to
stylesheets that load your stylesheet with the [`@use` rule](use). It makes it
possible to organize Sass libraries across many files, while allowing their
users to load a single entrypoint file.
Copy link
Member

@jelbourn jelbourn Sep 5, 2019

Choose a reason for hiding this comment

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

Using the word "stylesheet" three times so close together makes the sentence a bit hard to read, but I'm also having a hard time with an alternate wording. I'm thinking something kind of like

The `@forward` rule makes mixins, functions, and variables available for `@use` from a different
stylesheet than the one in which they're declared. A stylesheet using this rule _forwards_ these
symbols from the original location through itself. This allows Sass libraries to surface APIs from
multiple files through a single entry-point.

I'm also wondering if it makes sense to add a comparison like "The process of forwarding works similarly to re-exporting symbols in JavaScript, Python, etc."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using the word "stylesheet" three times so close together makes the sentence a bit hard to read, but I'm also having a hard time with an alternate wording. I'm thinking something kind of like

The `@forward` rule makes mixins, functions, and variables available for `@use` from a different
stylesheet than the one in which they're declared. A stylesheet using this rule _forwards_ these
symbols from the original location through itself. This allows Sass libraries to surface APIs from
multiple files through a single entry-point.

I don't think I like the "available for use from a different stylesheet than the one in which they're declared", because that could arguably describe @use as well. I've tried rewriting it to make the repetition less awkward; PTAL.

I'm also wondering if it makes sense to add a comparison like "The process of forwarding works similarly to re-exporting symbols in JavaScript, Python, etc."

In my experience, the people who most struggle to understand these docs are those coming to them from a non-programming background. I expect that most people who are familiar with re-exporting symbols will grok this pretty easily regardless.

---

It's written `@forward "<url>"`. It loads the module at the given URL just like
Copy link
Member

Choose a reason for hiding this comment

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

"It's written" -> "The rule uses the syntax"

("It" here could be ambiguous, plus a more active voice, though it is longer)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to "The rule is written". I want to keep the word "written" because it's consistently used as a signal word for "here comes the general syntax".

source/documentation/at-rules/forward.html.md.erb Outdated Show resolved Hide resolved
source/documentation/at-rules/forward.html.md.erb Outdated Show resolved Hide resolved
@nex3 nex3 requested a review from jelbourn September 5, 2019 23:58
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM, that first sentence is way better than what I had

Copy link
Contributor

@Awjin Awjin left a comment

Choose a reason for hiding this comment

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

LGTM, the "Adding a Prefix" section in particular was super clear

@nex3 nex3 merged commit d8c3238 into feature.use Sep 6, 2019
@nex3 nex3 deleted the forward branch September 6, 2019 21:13
asaf400 pushed a commit to asaf400/ass-site that referenced this pull request Apr 18, 2024
asaf400 pushed a commit to asaf400/ass-site that referenced this pull request Apr 18, 2024
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.

3 participants