rails/guides
Matheus Richard 8f0b9117b7 Dispatch direct-upload events on attachment uploads
When using Action Text's rich textarea,  it's possible to attach files to the
editor. Previously, that action didn't dispatch any events, which made it hard
to react to the file uploads. For instance, if an upload failed, there was no
way to notify the user about it, or remove the attachment from the editor.

This commits adds new events - `direct-upload:start`, `direct-upload:progress`,
and `direct-upload:end` - similar to how Active Storage's direct uploads work.

Closes #37793
Supersedes #37794

Co-authored-by: Brad Rees <github@bradleyrees.com>
2024-08-26 16:15:35 -03:00
..
assets Fixed significant styling issue 2024-08-23 16:34:40 +05:30
bug_report_templates Unpin sqlite3 version in bug_report_templates 2024-08-23 10:24:14 -03:00
rails_guides Cleanup the assets before generating the guides 2024-08-24 00:28:35 +00:00
source Dispatch direct-upload events on attachment uploads 2024-08-26 16:15:35 -03:00
.document
.rubocop.yml Document `response.parsed_body` in 7.1 release notes 2023-08-23 15:33:52 -04:00
CHANGELOG.md Register 8b173d9 in the guides CHANGELOG 2024-06-20 09:45:25 +02:00
README.md Fix rubocop offences for actionpack/lib/action_dispatch/journey/parser.rb 2024-08-20 12:30:20 +09:00
Rakefile Add rake guides:lint task to raise error on broken anchor links 2024-05-01 17:29:35 +05:30
rails_guides.rb Add rake guides:lint task to raise error on broken anchor links 2024-05-01 17:29:35 +05:30
w3c_validator.rb Use frozen string literal in guides/ 2017-08-13 22:04:09 +09:00

README.md

Rails Guides Redesign 2024

About the Project

The Rails Guides Visual Refresh occurred in Q1 2024, and was intended to bring the visual style of the guides inline with the rubyonrails.org site.

Editing Dependencies

The editing files for the Guides rebuild reside in stylesrc and use SCSS to improve developer experience. The code base relies on include_media (https://eduardoboucas.github.io/include-media/) to enable inline media-queries adjustments. We've also relied on the standard normalize.css (https://necolas.github.io/normalize.css/) to help bring all browsers together.

Building the Guides in Development

To generate new guides into static files, type rake guides:generate from inside the guides folder. If you make changes to the HTML or ERB, you'll need to remove the "output" directory before running this command. The master SCSS files (style.scss, highlight.scss) will compile as part of this process.

FAQ

Why are you not using CSS variables?

Per the MDN documentation on CSS custom properties (https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties), they are not supported in media or container queries at this point (Feb 2024). They may in future releases, and we should pivot to that when they are more wholistically supported. SCSS variables, because they are interpolated at build, serve a similar purpose and allow us the flexibility to support much older browsers.

Why do we include LTR and RTL?

LTR/RTL (Left to right/right to left) is a layout change based on the nature of the language the site is being displayed in. Arabic and Farsi are two well known "RTL" languages. If the site is automatically translated, then the layout will adjust (mirror horizontally) to be more in line with the text.

Why is Dark Mode in a separate file

IncludeMedia does not handle prefers-color-scheme at this time, so it was extracted.