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

CSS syntax module and error handling #31076

Merged
merged 43 commits into from
Dec 19, 2023
Merged

CSS syntax module and error handling #31076

merged 43 commits into from
Dec 19, 2023

Conversation

estelle
Copy link
Member

@estelle estelle commented Dec 16, 2023

The original task was to update the charset module. Turns out there is no such thing.
Charset was defined in CSS 2 but removed in the CSS syntax module.

  • Move css_charset to css_syntax.
  • Created a new document: css_syntax. This is a module landing page. It includes the key concepts introduced in that module.
  • Created a new document: a guide on CSS error handling by the parser. a subpage for CSS syntax.
  • Updated the @charset page to indicate that it is NOT an at-rule, and has been deprecated in css-syntax.
  • Updated custom-ident, the page that had the best explanation of CSS escape characters, adding a separate section for escaping characters in CSS. This PR does not include creating links to that section. That will be done as a separate PR (this PR is already big enough)
  • related to CSS Charsets openwebdocs/project#186

This PR was previously reviewed and is now co-authored by @dipikabh. See #30793

estelle and others added 30 commits December 4, 2023 20:29
Co-authored-by: Dipika Bhattacharya <[email protected]>
Co-authored-by: Dipika Bhattacharya <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label Dec 16, 2023
Copy link
Contributor

github-actions bot commented Dec 16, 2023

Preview URLs

External URLs (1)

URL: /en-US/docs/Web/CSS/custom-ident
Title: <custom-ident>

(comment last updated: 2023-12-19 14:25:39)

Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

Hi @estelle! Thanks for a great new set of content. I've included quite a lot of comments, but these are mainly just quibbles about individual grammar and prose points. There is a lot of dense detail in the error handling page, and a lot of my suggestions are centered around trying to make this great content as clear as possible.

files/en-us/web/css/@charset/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/@charset/index.md Outdated Show resolved Hide resolved

The **CSS syntax** module describes, in general terms, the structure and syntax of cascading stylesheets, or CSS. It defines CSS as the language for describing the rendering of structured documents (such as HTML and XML), on the web and elsewhere.

This module doesn't define any properties, {{cssxref("css_types", "data types")}}, {{cssxref("css_functions", "functions")}}, or {{cssxref("at-rule", "at-rules")}}. Rather, it elaborates on how all of these features should be defined and how user agents should parse CSS.
Copy link
Contributor

Choose a reason for hiding this comment

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

The links in this paragraph are not code terms but are formatted as such. Maybe use regular links for these? I'm not sure if csssxref allows you to do the same trick as domxref, e.g. {{cssxref("css_types", "data types", "", "nocode")}}, if you want them to not be shown in code font.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks. I did not know this trick.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oops, looks like the links got broken. As I feared, that trick doesn't work in cssxref, only domxref. I've fixed the links for you as a penance for wasting your time.

files/en-us/web/css/css_syntax/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/css_syntax/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/custom-ident/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/custom-ident/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/custom-ident/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/custom-ident/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/custom-ident/index.md Outdated Show resolved Hide resolved

Custom properties are generally considered valid when declared, but may create invalid CSS when accessed, i.e. they may be used as a value (via the {{cssxref("var")}} function) for a property that does not accept that value type. The browser parses each custom property when encountered without regard to where the property is consumed.

Generally, when a property value is invalid, the declaration is ignored and the property falls back to the last valid value. Invalid computed custom property values, however, work slightly differently.
Copy link
Contributor

Choose a reason for hiding this comment

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

[mdn-linter] reported by reviewdog 🐶

Suggested change
Generally, when a property value is invalid, the declaration is ignored and the property falls back to the last valid value. Invalid computed custom property values, however, work slightly differently.
Generally, when a property value is invalid, the declaration is ignored and the property falls back to the last valid value. Invalid computed custom property values, however, work slightly differently.

Copy link
Member Author

@estelle estelle left a comment

Choose a reason for hiding this comment

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

@chrisdavidmills Thanks for the feedback. I think i captured everything.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

Looking awesome, nice work @estelle (Simmons). Let's get this merged.

@chrisdavidmills chrisdavidmills merged commit 5affe90 into mdn:main Dec 19, 2023
8 checks passed
@estelle estelle deleted the charset branch January 9, 2024 03:49
dipikabh added a commit to dipikabh/content that referenced this pull request Jan 17, 2024
* New page: CSS syntax error handling

* deprecate @charset and list as a rule not at-rule

* Define character encoding

* New page: error handling

* New page: css syntax module

* delete charset module. move to syntax module

* still supported

* table of contents

* better grammar

* better grammar

* better grammar

* better grammar

* Apply suggestions from code review

Co-authored-by: Dipika Bhattacharya <[email protected]>

* added a few more notes - prefixes

* edits per review

* change h2 to h3

* Apply suggestions from code review

Co-authored-by: Dipika Bhattacharya <[email protected]>

* add guide to module page.

* change UA to browser

* address mdn#30793 (comment)

* hyphens to underscores

* rewrote the at-rule section

* rewrite grammar section

* fixing linter suggestions

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* final tweaks

* Update files/en-us/web/css/css_syntax/error_handling/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/css/css_syntax/error_handling/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix flaws

* closed comments

* borked so fixed

* trailing spaces

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/css/css_syntax/error_handling/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/css/css_syntax/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Small punctuation fixes

* Apply suggestions from code review

Co-authored-by: Chris Mills <[email protected]>

* header for at-rule

* updates based on review feedback

* link to display property

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/css/css_syntax/error_handling/index.md

* Update files/en-us/web/css/css_syntax/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix broken links

* typo fix

---------

Co-authored-by: Dipika Bhattacharya <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Mills <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants