ymcatwincities / openy

The Open Y platform. See README.md below
https://openy.org
GNU General Public License v3.0
49 stars 111 forks source link

Open Y Lily theme uses blocks IDs with name of the theme inside for CSS rules. #1631

Open afi13 opened 5 years ago

afi13 commented 5 years ago

Problem Lily theme uses blocks CSS selectors which contains the hardcoded name of the theme as ID of elements. Such approach is not flexible. It creates issues for all sub-themes inherited from Lily. Selectors don't work because any sub-theme has another name and another ID of blocks. Examples of wrong selectors: #block-openy-lily-branding, #block-openy-lily-footercopyrightblock, #block-openy-lily-footersocialblock, #block-openy-lily-googletranslate, etc

Proposed resolution Refactor Lily theme to replace all hardcoded selectors like #block-openy-lily-* with corresponding classes which are not related to the theme name.

podarok commented 5 years ago

@afi13 this is slippery slope When you implement subtheme what should be more important - to keep base theme branding, or to allow subtheme to provide own. I guess we can live with current solution, because we don't have any data that proves branding should be inherited in subtheme. I remember in the past we have a request to rely on theme name to be able to have different experiences for different themes. Why would you call #block-openy-lily-branding, #block-openy-lily-footercopyrightblock, #block-openy-lily-footersocialblock, #block-openy-lily-googletranslate as wrong selectors? Could you provide more details about issues your are facing with before naming this as a bug?

afi13 commented 5 years ago

@podarok A sub-theme inherits all styles from parent theme by default because this is the main point for sub-themes - they inherit the parent theme's resources. But it doesn't work with Open Lily out of the box. Example: You use Open Y with Lily theme on your website. All pages look ok for you, but you want to add small changes in HTML of Branch nodes. In the current implementation, you can't just create sub-theme from Lily and override the branch node template. Because the branch pages will be broken and you must copy-paste a lot of CSS from the parent theme with renamed selectors to fix that. I don't think it's a good approach. I can do that with any Drupal contrib theme, but not with Open Y lily. I hope it's more clear now. Also using ID in CSS selectors is not very good practice.

podarok commented 5 years ago

@afi13 let me know if this could be fixed in the scope of YGTC CMS Optimization project

sarah-halby commented 3 years ago

Reference to this item: https://github.com/ymcatwincities/openy/issues/1307 - once 1307 is closed, this item can be closed as well.