localgovdrupal / localgov_base

The base theme for LocalGov Drupal websites.
9 stars 15 forks source link

Move components to use new Single Directory Components module #592

Open markconroy opened 2 months ago

markconroy commented 2 months ago

I think two items we could try moving first are

  1. Add to Calendar, and
  2. Previous Next

They are both already in a _components directory with other templates that using them via {% include %} or something similar, so they should not be much work to move.


Thanks to Big Blue Door for sponsoring my time to work on this.

ctorgalson commented 2 months ago

I'll have a go at Previous Next to start since I've been working around it recently.

ctorgalson commented 2 months ago

@markconroy what are your thoughts about localgov_base_remove_css?

SDC's don't normally explicitly include their libraries, but we'd have to in order to make that setting effective for an SDC.


Added: unless we did something like change the class main lgd-prev-next-- class prefix only when localgov_base_remove_css was true.

markconroy commented 2 months ago

I bet if we did a survey, no council has ever turned on that remove CSS feature. It's a cool idea, but I don't see why anyone would turn it on.

ctorgalson commented 2 months ago

@markconroy I haven't noticed modals on LGD projects outside of add-to-calendar buttons, but I did add a11y-dialog to an LGD project for another purpose.

It looks like it would be fairly easy to separate out the modal as its own SDC and have add-to-calendar call it internally if you think it'd be helpful.

markconroy commented 1 month ago

I think I'd leave the add-to-calendar dialog as is. I created that as a fully-independent element so it could be styled specifically for the add-to-calendar widget.

I'm no against us creating a generic dialog also if we thought that would be handy for other things that might be useful in a dialog (secondary navigation comes to mind).

markconroy commented 1 month ago

@ctorgalson This issue looks like it's almost ready. But before we merge it, has it been tested with sub-themes of LocalGov Base, especially ones that one to override the components we are moving to SDC, such as something that wants to set the add to calendar title to pink for example?

ctorgalson commented 1 month ago

Haven't tested that way. I guess we should test the following (please suggest anything I might've missed):