Skip to content

Commit

Permalink
Move shared component stylesheets to shared folder
Browse files Browse the repository at this point in the history
We had an inconsistency where most stylesheets associated to a component
would have the same relative path as their component, so if we had a
component in `app/components/admin/whatever`, its associated stylesheet
would be in `app/assets/stylesheets/admin/whatever`.

There was one exception to this rule: stylesheets for components in
`app/components/shared/` were placed in `app/assets/stylesheets/`. The
reason was that we thought "well... if they're in the root folder,
they're shared". However, this is confusing because in the root folder
there are also stylesheets that aren't associated to a component.

So we're creating the `app/assets/stylesheets/shared/` folder. This also
means we don't have to manually add every stylesheet in this folder the
the `application.scss` file.

We aren't the same for JavaScript files because with JavaScript we still
don't have a clear association between JavaScript files and components.
Only a couple of them (`advanced_search.js` and `check_all_none.js`)
would be good candidates, and the one for the advanced search form
doesn't even use the `.advanced-search-form` selector that we use in the
CSS file.
  • Loading branch information
javierm committed Apr 12, 2024
1 parent c3a745f commit 1c86e33
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions app/assets/stylesheets/application.scss
Expand Up @@ -22,28 +22,19 @@
@import "mixins/*";

@import "admin";
@import "advanced_search";
@import "annotator_overrides";
@import "autocomplete_overrides";
@import "avatar";
@import "banner";
@import "check_all_none";
@import "comments_count";
@import "datepicker_overrides";
@import "layout";
@import "participation";
@import "milestones";
@import "pages";
@import "dashboard";
@import "in_favor_against";
@import "legislation";
@import "legislation_process";
@import "legislation_process_form";
@import "map_location";
@import "moderation_actions";
@import "notification_item";
@import "community";
@import "search_results_summary";
@import "stats";
@import "sticky_overrides";
@import "tags";
Expand All @@ -61,6 +52,7 @@
@import "sdg/**/*";
@import "sdg_management/*";
@import "sdg_management/**/*";
@import "shared/**/*";
@import "subscriptions";
@import "widgets/**/*";

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1c86e33

Please sign in to comment.