diff --git a/docs/frontend/styles/index.css b/docs/frontend/styles/index.css index 4ba7b64..58b8e89 100644 --- a/docs/frontend/styles/index.css +++ b/docs/frontend/styles/index.css @@ -2,7 +2,7 @@ --body-background: #f2f2f2; --body-color: #444; --heading-color: black; - --action-color: #d64045; + --action-color: #931a1e; } body { @@ -19,7 +19,6 @@ body { a { color: var(--action-color); text-decoration: underline; - text-decoration-color: #ffb088; } h1 { @@ -36,10 +35,11 @@ body > header { text-align: center; } -body > header img { - display: inline-block; - width: 400px; - max-width: 100%; +body > header .site-title { + font-size: 2rem; + font-weight: bold; + text-decoration: none; + color: var(--heading-color); } body > nav ul { diff --git a/docs/frontend/styles/syntax-highlighting.css b/docs/frontend/styles/syntax-highlighting.css index 207188b..e11cc09 100644 --- a/docs/frontend/styles/syntax-highlighting.css +++ b/docs/frontend/styles/syntax-highlighting.css @@ -15,23 +15,23 @@ pre.highlight { } .highlight .hll { background-color: #ffffcc } -.highlight .c { color: #999988; font-style: italic } /* Comment */ +.highlight .c { color: #646457; font-style: italic } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #000000; font-weight: bold } /* Keyword */ .highlight .o { color: #000000; font-weight: bold } /* Operator */ -.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */ -.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ +.highlight .cm { color: #646457; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #646464; font-weight: bold; font-style: italic } /* Comment.Preproc */ +.highlight .c1 { color: #646457; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #646464; font-weight: bold; font-style: italic } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ -.highlight .gh { color: #999999 } /* Generic.Heading */ +.highlight .gh { color: #646464 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ -.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .go { color: #5a5a5a } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #aaaaaa } /* Generic.Subheading */ +.highlight .gu { color: #646464 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #000000; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */ @@ -39,12 +39,12 @@ pre.highlight { .highlight .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */ .highlight .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ -.highlight .m { color: #009999 } /* Literal.Number */ -.highlight .s { color: #d01040 } /* Literal.String */ -.highlight .na { color: #008080 } /* Name.Attribute */ -.highlight .nb { color: #0086B3 } /* Name.Builtin */ +.highlight .m { color: #0a6e6e } /* Literal.Number */ +.highlight .s { color: #a01030 } /* Literal.String */ +.highlight .na { color: #0a5e5e } /* Name.Attribute */ +.highlight .nb { color: #005880 } /* Name.Builtin */ .highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ -.highlight .no { color: #008080 } /* Name.Constant */ +.highlight .no { color: #0a5e5e } /* Name.Constant */ .highlight .nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */ .highlight .ni { color: #800080 } /* Name.Entity */ .highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ @@ -52,26 +52,26 @@ pre.highlight { .highlight .nl { color: #990000; font-weight: bold } /* Name.Label */ .highlight .nn { color: #555555 } /* Name.Namespace */ .highlight .nt { color: #000080 } /* Name.Tag */ -.highlight .nv { color: #008080 } /* Name.Variable */ +.highlight .nv { color: #0a5e5e } /* Name.Variable */ .highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mf { color: #009999 } /* Literal.Number.Float */ -.highlight .mh { color: #009999 } /* Literal.Number.Hex */ -.highlight .mi { color: #009999 } /* Literal.Number.Integer */ -.highlight .mo { color: #009999 } /* Literal.Number.Oct */ -.highlight .sb { color: #d01040 } /* Literal.String.Backtick */ -.highlight .sc { color: #d01040 } /* Literal.String.Char */ -.highlight .sd { color: #d01040 } /* Literal.String.Doc */ -.highlight .s2 { color: #d01040 } /* Literal.String.Double */ -.highlight .se { color: #d01040 } /* Literal.String.Escape */ -.highlight .sh { color: #d01040 } /* Literal.String.Heredoc */ -.highlight .si { color: #d01040 } /* Literal.String.Interpol */ -.highlight .sx { color: #d01040 } /* Literal.String.Other */ -.highlight .sr { color: #009926 } /* Literal.String.Regex */ -.highlight .s1 { color: #d01040 } /* Literal.String.Single */ +.highlight .w { color: #777777 } /* Text.Whitespace */ +.highlight .mf { color: #0a6e6e } /* Literal.Number.Float */ +.highlight .mh { color: #0a6e6e } /* Literal.Number.Hex */ +.highlight .mi { color: #0a6e6e } /* Literal.Number.Integer */ +.highlight .mo { color: #0a6e6e } /* Literal.Number.Oct */ +.highlight .sb { color: #a01030 } /* Literal.String.Backtick */ +.highlight .sc { color: #a01030 } /* Literal.String.Char */ +.highlight .sd { color: #a01030 } /* Literal.String.Doc */ +.highlight .s2 { color: #a01030 } /* Literal.String.Double */ +.highlight .se { color: #a01030 } /* Literal.String.Escape */ +.highlight .sh { color: #a01030 } /* Literal.String.Heredoc */ +.highlight .si { color: #a01030 } /* Literal.String.Interpol */ +.highlight .sx { color: #a01030 } /* Literal.String.Other */ +.highlight .sr { color: #0a7a25 } /* Literal.String.Regex */ +.highlight .s1 { color: #a01030 } /* Literal.String.Single */ .highlight .ss { color: #990073 } /* Literal.String.Symbol */ -.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #008080 } /* Name.Variable.Class */ -.highlight .vg { color: #008080 } /* Name.Variable.Global */ -.highlight .vi { color: #008080 } /* Name.Variable.Instance */ -.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ +.highlight .bp { color: #646464 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #0a5e5e } /* Name.Variable.Class */ +.highlight .vg { color: #0a5e5e } /* Name.Variable.Global */ +.highlight .vi { color: #0a5e5e } /* Name.Variable.Instance */ +.highlight .il { color: #0a6e6e } /* Literal.Number.Integer.Long */ diff --git a/docs/src/_components/shared/navbar.erb b/docs/src/_components/shared/navbar.erb index 1565e29..81d396b 100644 --- a/docs/src/_components/shared/navbar.erb +++ b/docs/src/_components/shared/navbar.erb @@ -1,11 +1,10 @@
- Logo + a11y-lint
diff --git a/docs/src/_data/site_metadata.yml b/docs/src/_data/site_metadata.yml index d60f97d..ff6e903 100644 --- a/docs/src/_data/site_metadata.yml +++ b/docs/src/_data/site_metadata.yml @@ -1,11 +1,5 @@ -# Site settings -# These are used to personalize your new site. If you look in the HTML files, -# you will see them accessed via {{ site.metadata.title }}, {{ site.metadata.email }}, and so on. -# You can create any custom variable you would like, and they will be accessible -# in the templates via {{ site.metadata.myvariable }}. - -title: Your awesome title -tagline: This site is totally awesome -email: your-email@example.com +title: a11y-lint +tagline: Accessibility linting for Rails templates description: >- - Write an awesome description for your new site here. It will appear in your document head meta (for Google search results) and in your feed.xml site description. + a11y-lint is a Ruby gem that lints Rails view code — Slim, ERB, and Phlex — for accessibility mistakes. It runs against your template source, in CI, before any HTML reaches a user. +github: https://github.com/Guided-Rails/a11y-lint diff --git a/docs/src/_partials/_footer.erb b/docs/src/_partials/_footer.erb index 7614673..d15dbe2 100644 --- a/docs/src/_partials/_footer.erb +++ b/docs/src/_partials/_footer.erb @@ -1,3 +1,3 @@ diff --git a/docs/src/about.md b/docs/src/about.md deleted file mode 100644 index 93cce53..0000000 --- a/docs/src/about.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: page -title: About ---- - -This is the basic Bridgetown site template. You can find out more info about customizing your Bridgetown site, as well as basic Bridgetown usage documentation at [bridgetownrb.com](https://bridgetownrb.com/) - -You can find the source code for Bridgetown at GitHub: -[bridgetownrb](https://github.com/bridgetownrb) / -[bridgetown](https://github.com/bridgetownrb/bridgetown) diff --git a/docs/src/images/logo.svg b/docs/src/images/logo.svg deleted file mode 100644 index 3006b5e..0000000 --- a/docs/src/images/logo.svg +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/src/index.md b/docs/src/index.md index 2b3cc7f..ad01e58 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,20 +1,58 @@ --- -# Feel free to add content and custom Front Matter to this file. - layout: default --- -# Welcome to your new Bridgetown website. +# README + +Catch accessibility bugs in your Rails templates before they ship. + +a11y-lint is a Ruby gem that lints Rails view code — Slim, ERB, and Phlex — for accessibility mistakes that browser-based checkers can only see *after* a page has rendered. It runs against your template source, in CI, on every PR, before any HTML reaches a user. + +## What it catches + +a11y-lint focuses on issues that are unambiguously wrong in source code — the kind of mistakes a static check should catch so that human review can spend its attention on judgement calls. Two rule sets ship today: + +- [Images need alt text](/rules/images-need-alt-text/) — ``, ``, ``, and the matching Rails helpers (`image_tag`, `image_submit_tag`) with no `alt` attribute. Covers WCAG 1.1.1. +- [Form controls need accessible names](/rules/form-controls-need-accessible-names/) — Simple Form `form.input` calls that suppress the visible label without providing an `aria-label` or `aria-labelledby`. Covers WCAG 4.1.2. + +More are on the way. See the [rule reference](/rules/images-need-alt-text/) for the full set, including what each rule does and doesn't catch. + +## Who it's for + +Rails apps that render views with **Slim**, **ERB**, or **Phlex**. The same rules run across all three pipelines, so a mixed codebase is a first-class case rather than an afterthought. + +It's most useful on teams that: + +- Want accessibility caught at PR time, not in a manual audit weeks later. +- Already run RuboCop in CI and want to add a11y checks to the same step. +- Have a long-lived codebase where templates have drifted across formats. + +## Install + +Add the gem to your `Gemfile`: + +```ruby +gem "a11y-lint" +``` + +Then run it against your views: + +```bash +bundle exec a11y-lint app/views +``` -You can learn more about how to build and deploy your new website by reading the [Bridgetown documentation](https://www.bridgetownrb.com/docs). +With no arguments it scans the current directory recursively for `.slim`, `.erb`, and `.rb` (Phlex) files. -You can add some [plugins](https://www.bridgetownrb.com/plugins/) to get started quickly or [write your own](https://www.bridgetownrb.com/docs/plugins) to extend the functionality of your site. +To enable or disable specific rules, drop a `.a11y-lint.yml` at your project root: -Be sure to check out the [Bridgetown Discord chat](https://discord.gg/4E6hktQGz4) if you have questions or are looking for helpful tips & tricks. +```yaml +ImgMissingAlt: + Enabled: false +``` -_Have fun and **good luck**!_ +Rules not listed are enabled by default. The full configuration format is on the [GitHub README](https://github.com/Guided-Rails/a11y-lint#configuration). ----- +## What's next -**Generated by v2.1.2** -{:style="text-align:center"} +- Read the [rule reference](/rules/images-need-alt-text/) to see what each rule catches and where it stops. +- Source and issue tracker: [github.com/Guided-Rails/a11y-lint](https://github.com/Guided-Rails/a11y-lint). diff --git a/docs/src/posts.md b/docs/src/posts.md deleted file mode 100644 index 1e27997..0000000 --- a/docs/src/posts.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -layout: page -title: Posts ---- - - - -If you have a lot of posts, you may want to consider adding [pagination](https://www.bridgetownrb.com/docs/content/pagination)!