Skip to content

Setup tailwind; create base template #554

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

Open
wants to merge 3 commits into
base: ui-main
Choose a base branch
from
Open

Setup tailwind; create base template #554

wants to merge 3 commits into from

Conversation

sravfeyn
Copy link
Member

Product Description

This sets up

  • webpack based tailwind
  • a base template that can be extended by other pages (I have tested the base page using a local test view)

Technical Summary

Safety Assurance

Safety story

Automated test coverage

QA Plan

Labels & Review

  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@sravfeyn sravfeyn requested a review from calellowitz April 10, 2025 16:18
@calellowitz
Copy link
Collaborator

Shouldn't this be against a new branch? ui-main or whatever name we settled on, rather than main? We will also want that branch included in our list of branches to run CI against

Copy link
Collaborator

@calellowitz calellowitz left a comment

Choose a reason for hiding this comment

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

Left a few questions (and the comment outside review) but generally looks good. Glad to see this start to take shape.

@@ -44,7 +48,10 @@ module.exports = {
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: ['postcss-preset-env', 'autoprefixer', 'pixrem'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we no longer using the removed plugins?

Copy link
Member Author

Choose a reason for hiding this comment

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

Both pixrem and postcss-preset-env are relevant when we had raw css. With tailwindcss there should be no need for these. All the UI pages that got built by yume-labs used this config and no issue tied to this was observed. So I think it's a safe change

{
test: /\.js$/,
exclude: /node_modules/,
Copy link
Collaborator

Choose a reason for hiding this comment

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

what does this change do?

Copy link
Member Author

Choose a reason for hiding this comment

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

note_modules is generated by npm/yarn and are already prebuilt, so this just excludes running babel-loader on them in the build process. So, it it should just improve the build speed without affecting anything

@@ -30,9 +34,9 @@ module.exports = {
],
module: {
rules: [
// we pass the output from babel loader to react-hot loader
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this no longer true?

Copy link
Member Author

Choose a reason for hiding this comment

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

We do, I think I removed some comments as I edited the file. I can add back

<div class="h-5 w-full mt-16"></div>
<main id="content" class="md:max-w-screen-2xl mx-auto">
{% block content %}
{% endblock %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Our current base template includes blocks for messages, modals, and inline js. Do we no longer need those, will they be added elsewhere, or just added later to the base?

Copy link
Member Author

Choose a reason for hiding this comment

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

They will be added in the PRs that need it.

</div>

<!-- Selected -->
<!-- {% if sidenav_active == name %} -->
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be commented out?

Copy link
Member Author

Choose a reason for hiding this comment

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

I commented it out when I tried to test active state, forgot to uncomment. Done that

<div x-show="open" x-transition.opacity x-cloak class="absolute top-12 right-0 min-w-56 bg-white shadow rounded-lg z-50">
<ul class="p-2 w-full">
<li class="p-2 hover:bg-gray-100 rounded cursor-pointer text-left">
<p class="text-brand-deep-purple text-sm font-medium">Meca Healthcare</p>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like there is hardcoded data here

Copy link
Member Author

Choose a reason for hiding this comment

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

These are added as placeholder here, they are getting overridden in #555


<!-- User Profile Selector -->
<div x-show="open" x-transition.opacity x-cloak class="absolute top-12 right-0 min-w-56 w-56 bg-white shadow rounded-lg z-50">
<ul class="p-2 w-full">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where do these items go?

Copy link
Member Author

Choose a reason for hiding this comment

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

Here
Screenshot 2025-04-11 at 7 48 18 AM

{% url 'program:home' request.org.slug as program_home_url %}
{% include "tailwind/components/sidenav-items.html" with name='Programs' icon='table-columns' target=program_home_url %}
{% include "tailwind/components/sidenav-items.html" with name='Opportunities' icon='table-cells-large' target='/opportunities' %}
{% include "tailwind/components/sidenav-items.html" with name='Analytics' icon='chart-pie' target='/analytics' %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought we were skipping this one?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't get a confirmation yet on this. I can remove it once Rama confirms

</div>

<!-- Bottom Section -->
<div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where do these items go?

Copy link
Member Author

Choose a reason for hiding this comment

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

Bottom left in the attached screenshot, perhaps the settings need to be removed.

@calellowitz
Copy link
Collaborator

calellowitz commented Apr 11, 2025

(I have tested the base page using a local test view)

Is it possible to include a screenshot of this?

@sravfeyn
Copy link
Member Author

Screenshot 2025-04-11 at 7 45 19 AM

@sravfeyn
Copy link
Member Author

sravfeyn commented Apr 11, 2025

Shouldn't this be against a new branch? ui-main or whatever name we settled on, rather than main? We will also want that branch included in our list of branches to run CI against

Updated.
(I created this branch out of my own naming convention on my env). It would be same diff

@sravfeyn sravfeyn changed the base branch from main to ui-main April 11, 2025 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants