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

Add possibility of overriding the tailwind.config.js #11763

Merged
merged 4 commits into from
Oct 16, 2023

Conversation

alecslupu
Copy link
Contributor

@alecslupu alecslupu commented Oct 16, 2023

🎩 What? Why?

At the europeean commission we need to add some customization in the font face and other elements, and, for that would be ok to add them in Tailwind . For instance, several things that we need to override :

  • Adjust font sizes
  • Add a new font family
  • Change some paddings

📌 Related Issues

Link your PR to an issue

  • Related to N/A

Testing

  1. Create a development application
  2. create a file named config/tailwind.config.js.erb following the template
  3. Edit the newly created file ( ex change Font sizes )
  4. See the generated tailwind config contains the values customized

♥️ Thank you!

@alecslupu alecslupu added the contract: redesign Barcelona City Council contract label Oct 16, 2023
@alecslupu alecslupu marked this pull request as ready for review October 16, 2023 08:13
@alecslupu alecslupu requested a review from a team October 16, 2023 10:03
@microstudi
Copy link
Contributor

This is very good, it should be documented!

@andreslucena
Copy link
Member

This is very good, it should be documented!

I was just searching for the correct file to propose... Probably this is the right place: https://github.com/decidim/decidim/blob/develop/docs/modules/customize/pages/styles.adoc - a new section that says "Tailwind" just after "Webpacker". A good starting point is the instruction from the "Testing" section of this same PR.

Can you do that @alecslupu ?

@alecslupu
Copy link
Contributor Author

This is very good, it should be documented!

I was just searching for the correct file to propose... Probably this is the right place: https://github.com/decidim/decidim/blob/develop/docs/modules/customize/pages/styles.adoc - a new section that says "Tailwind" just after "Webpacker". A good starting point is the instruction from the "Testing" section of this same PR.

Can you do that @alecslupu ?

yes, can be done.

@alecslupu
Copy link
Contributor Author

This is very good, it should be documented!

I was just searching for the correct file to propose... Probably this is the right place: https://github.com/decidim/decidim/blob/develop/docs/modules/customize/pages/styles.adoc - a new section that says "Tailwind" just after "Webpacker". A good starting point is the instruction from the "Testing" section of this same PR.
Can you do that @alecslupu ?

yes, can be done.

@andreslucena the few lines have been added a s documentation. Can you have a look and suggest what other information we could add there ?

Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

Just tried it locally and it works perfect!

I'd want to make this discoverable, and also to prevent people from changing directly the tailwind.config.js (that's how I thought this should be done!), so how about adding a header in the template?

diff --git a/decidim-core/lib/decidim/assets/tailwind/tailwind.config.js.erb b/decidim-core/lib/decidim/assets/tailwind/tailwind.config.js.erb
index 6014d388d9..c67b873259 100644
--- a/decidim-core/lib/decidim/assets/tailwind/tailwind.config.js.erb
+++ b/decidim-core/lib/decidim/assets/tailwind/tailwind.config.js.erb
@@ -1,3 +1,10 @@
+// This file is automatically generated.
+// Do not edit this file, it will be overwritten
+//
+// If you want to modify it, follow instructions from
+// https://docs.decidim.org/en/develop/customize/styles
+//
+
 const { inherit, current, transparent, white } = require("tailwindcss/colors")
 
 const withOpacity =

@andreslucena andreslucena added type: change PRs that implement a change for an existing feature team: documentation labels Oct 16, 2023
@alecslupu
Copy link
Contributor Author

Just tried it locally and it works perfect!

I'd want to make this discoverable, and also to prevent people from changing directly the tailwind.config.js (that's how I thought this should be done!), so how about adding a header in the template?

diff --git a/decidim-core/lib/decidim/assets/tailwind/tailwind.config.js.erb b/decidim-core/lib/decidim/assets/tailwind/tailwind.config.js.erb
index 6014d388d9..c67b873259 100644
--- a/decidim-core/lib/decidim/assets/tailwind/tailwind.config.js.erb
+++ b/decidim-core/lib/decidim/assets/tailwind/tailwind.config.js.erb
@@ -1,3 +1,10 @@
+// This file is automatically generated.
+// Do not edit this file, it will be overwritten
+//
+// If you want to modify it, follow instructions from
+// https://docs.decidim.org/en/develop/customize/styles
+//
+
 const { inherit, current, transparent, white } = require("tailwindcss/colors")
 
 const withOpacity =

@andreslucena this is ready for another round. The change was applied in 0f2b0c6

Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

👍🏽

@alecslupu
Copy link
Contributor Author

Merging as per @andreslucena 's approval.

@alecslupu alecslupu merged commit e38b433 into develop Oct 16, 2023
104 checks passed
@alecslupu alecslupu deleted the chore/fix-tailwind-path branch October 16, 2023 14:26
entantoencuanto added a commit that referenced this pull request Oct 17, 2023
* develop: (30 commits)
  Add `process-content` to erb-lint's deprecated classes (#11762)
  Add possibility of overriding the tailwind.config.js (#11763)
  Ask old password when changing email or password (#11737)
  Add Projects (Budgets) to filtered search (#11740)
  Fix missing results on Geocoded when search without diacritics (#11761)
  Add robots.txt instructions (#11693)
  Add missing activerecord budget locales for search (#11766)
  Improve design of Admin's Sidebar pages (#11759)
  Show small static map on admin's meetings index with big screens  (#11715)
  Remove "Manage" button when there's a Sidebar (#11717)
  Fix admin breadcrumb in Process (#11757)
  Apply new rubocop rules on erb - Layout/MultilineMethodCallIndentation (#11756)
  Remove xlarge-* references from admin forms (#11712)
  Apply new rubocop rules on erb - Argument identation (#11707)
  Update HERE API autocomplete (#11507)
  Admin redesign proposal issues (#11668)
  Redesign: responsive links on cards (#11538)
  Refactor CI pipelines (#11196)
  Update postcss and graphql to latest versions (#11733)
  Fix develop pipeline (#11750)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contract: redesign Barcelona City Council contract team: documentation type: change PRs that implement a change for an existing feature
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants