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

Box Menu: Add variable to control item padding #506

Closed
swashbuck opened this issue Mar 29, 2024 · 5 comments · Fixed by #517
Closed

Box Menu: Add variable to control item padding #506

swashbuck opened this issue Mar 29, 2024 · 5 comments · Fixed by #517

Comments

@swashbuck
Copy link
Contributor

swashbuck commented Mar 29, 2024

Subject of the issue

Currently, the box menu item padding for .boxmenu-item__inner is hardcoded to 1rem. I would suggest that we add a new variable to control this padding value.

Perhaps these variables could be called @menu-item-inner-padding-ver and @menu-item-inner-padding-horz and would live in _spacing-containers.less.

Your environment

  • Vanilla 9.16.2

Screenshots

The padding is represented by the purple highlighted area.

Example AD that requires more padding:

@guywillis
Copy link
Contributor

I am all in favour of this change.

I do have some considerations though:

  • Would the name of the variables @menu-item-padding-ver and @menu-item-padding-hoz be more descriptive?
    • The suggested names above are to keep consistency with other variables names at the same level @menu-item, @menu-item-inverted, '@menu-item-title' etc
    • and to keep consistency with other padding variable names @page-padding-hoz, '@block-padding-hoz' etc
  • The proposed names above would mean that the current @menu-item-padding-ver and @menu-item-padding-hoz variables would need to be renamed to @menu-item-margin-ver and @menu-item-margin-hoz respectively
  • The variables be placed within the _spacing-containers.less file

@swashbuck
Copy link
Contributor Author

Would the name of the variables @menu-item-padding-ver and @menu-item-padding-hoz be more descriptive?

Yes, these names more adequately describe their purpose.

The proposed names above would mean that the current @menu-item-padding-ver and @menu-item-padding-hoz variables would need to be renamed to @menu-item-margin-ver and @menu-item-margin-hoz respectively

This makes sense as the current menu item padding variables are actually applied to margins. My only concern is breakage and backwards compatibility with custom themes. We can give the new @menu-item-margin-* variables the same defaults that they have now, but it may trip up theme developers when they find that their variable overrides are no longer working as intended.

That said, I do agree with your approach overall. Thoughts on how we could mitigate the variable renaming issues? Is this something we need to worry about? How often do you actually modify these two variables?

@guywillis
Copy link
Contributor

My only concern is breakage and backwards compatibility with custom themes. We can give the new @menu-item-margin-* variables the same defaults that they have now, but it may trip up theme developers when they find that their variable overrides are no longer working as intended.

That said, I do agree with your approach overall. Thoughts on how we could mitigate the variable renaming issues? Is this something we need to worry about? How often do you actually modify these two variables?

A very valid concern.

Personally, I do not often modify these values when building. Am acutely aware that I may be the exception here though.

Perhaps simply a breaking change is required?

@kirsty-hames
Copy link
Contributor

Hey @swashbuck / @guywillis, with hindsight @menu-item-margin-ver and @menu-item-margin-hoz would have been the ideal naming for the margin variables however I'm in favour of avoiding breaking changes where we can.
I think the initial suggestion of @menu-item-inner-padding-ver and @menu-item-inner-padding-horz is descriptive of where the style is applied at least, .boxmenu-item__inner and it is the inside padding. I don't mind too much that the other variables at this level don't include 'inner' in their variable name.

@swashbuck swashbuck self-assigned this May 13, 2024
github-actions bot pushed a commit that referenced this issue May 21, 2024
## [9.17.3](v9.17.2...v9.17.3) (2024-05-21)

### Fix

* Add variables to control box menu item padding (fixes #506) #517 ([92ccf46](92ccf46)), closes [#506](#506) [#517](#517)
Copy link

🎉 This issue has been resolved in version 9.17.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to redwoodperforms/adapt-contrib-vanilla that referenced this issue Aug 19, 2024
# [7.1.0](v7.0.1...v7.1.0) (2024-08-19)

### Fix

* Add 'bg-color white' mixin (adaptlearning#461) ([79f9011](79f9011)), closes [adaptlearning#461](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/461)
* Add hover effect to GMCQ items to match MCQ items (fixes adaptlearning#513) ([030c251](030c251)), closes [adaptlearning#513](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/513)
* Add margins for mobile stacked layout (fixes adaptlearning#450) ([988d68f](988d68f)), closes [adaptlearning#450](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/450)
* Add menu subtitle color variable (fixes adaptlearning#515) (adaptlearning#516) ([a1b8aba](a1b8aba)), closes [adaptlearning#515](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/515) [adaptlearning#516](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/516)
* Add schema default values for background image styles (fixes adaptlearning#456) ([17134df](17134df)), closes [adaptlearning#456](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/456)
* Add variables to control box menu item padding (fixes adaptlearning#506) adaptlearning#517 ([92ccf46](92ccf46)), closes [adaptlearning#506](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/506) [adaptlearning#517](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/517)
* background and headerBackground undefined variable errors (fixes adaptlearning#462) (adaptlearning#463) ([ad4d5ba](ad4d5ba)), closes [adaptlearning#462](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/462) [adaptlearning#463](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/463)
* Bump braces from 3.0.2 to 3.0.3 (adaptlearning#519) ([1b8a0c2](1b8a0c2)), closes [adaptlearning#519](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/519)
* Change @max-width to 100%, remove max-width: inherit from .page (adaptlearning#494) ([0a204a3](0a204a3)), closes [adaptlearning#494](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/494)
* Component background image support (fixes adaptlearning#511) (adaptlearning#512) ([1ca97b5](1ca97b5)), closes [adaptlearning#511](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/511) [adaptlearning#512](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/512)
* Increase container horizontal padding (gutters & margins) (adaptlearning#435) ([3ab5675](3ab5675)), closes [adaptlearning#435](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/435)
* Loading animation updated (fixes adaptlearning#500) (adaptlearning#501) ([2c24965](2c24965)), closes [adaptlearning#500](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/500) [adaptlearning#501](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/501)
* Matching dropdown list style improvements (fixes adaptlearning#478) (adaptlearning#507) ([c77980a](c77980a)), closes [adaptlearning#478](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/478) [adaptlearning#507](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/507)
* Neutralised `nav-btn-*` variables (adaptlearning#477) ([4120884](4120884)), closes [adaptlearning#477](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/477)
* Optimise `blend.less` (adaptlearning#503) ([bc7a7f8](bc7a7f8)), closes [adaptlearning#503](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/503)
* prevent notify btn hover style override (adaptlearning#483) ([7c88e60](7c88e60)), closes [adaptlearning#483](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/483)
* Remove background color when using pin images (adaptlearning#454) ([6aaa5e7](6aaa5e7)), closes [adaptlearning#454](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/454)
* remove legacy z-index from slider number selection / model answer (adaptlearning#489) ([932d416](932d416)), closes [adaptlearning#489](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/489)
* Utilize .size-small class for .hide-on-mobile class (adaptlearning#495) ([fbb693d](fbb693d)), closes [adaptlearning#495](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/495)

### New

* Add drawer item locked state  (adaptlearning#488) ([79aad47](79aad47)), closes [adaptlearning#488](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/488)
* Add margin start and margin end column classes (fixes adaptlearning#504) ([5ee17b7](5ee17b7)), closes [adaptlearning#504](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/504)
* Add text-transform variables (fixes adaptlearning#479) ([1d963a6](1d963a6)), closes [adaptlearning#479](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/479)
* expand on Narrative progress indicator state styles (fixes adaptlearning#509) (adaptlearning#510) ([5010471](5010471)), closes [adaptlearning#509](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/509) [adaptlearning#510](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/510)

### Update

* Hotgraphic pin number inherits from the icon styles (fixes adaptlearning#282) ([6abf34f](6abf34f)), closes [adaptlearning#282](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/282)
* Media transcript completion styling (adaptlearning#475) ([7d4d5f7](7d4d5f7)), closes [adaptlearning#475](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/475)
* menu item image margin updated (fixes adaptlearning#520) ([25dd6b7](25dd6b7)), closes [adaptlearning#520](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/520)
* Nav styling amends (adaptlearning#474) ([bf02388](bf02388)), closes [adaptlearning#474](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/474)
* remove default color hex codes from schemas (fixes adaptlearning#464) (adaptlearning#468) ([4f4acbf](4f4acbf)), closes [adaptlearning#464](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/464) [adaptlearning#468](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/468)
* Replace PLP hard coded border-radius with variable (fixes adaptlearning#498) (adaptlearning#499) ([666b472](666b472)), closes [adaptlearning#498](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/498) [adaptlearning#499](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/499)
* RTL styling (adaptlearning#481) ([14b2bf9](14b2bf9)), closes [adaptlearning#481](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/481)
* Update visited color variables (fixes adaptlearning#470) ([c0bebdd](c0bebdd)), closes [adaptlearning#470](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/470)
* use display flex to set equal menu item heights (fixes adaptlearning#466) (adaptlearning#467) ([84e9379](84e9379)), closes [adaptlearning#466](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/466) [adaptlearning#467](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/467)

### Upgrade

* Bump ip from 1.1.8 to 1.1.9 (adaptlearning#497) ([e40efcf](e40efcf)), closes [adaptlearning#497](https://github.com/redwoodperforms/adapt-contrib-vanilla/issues/497)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants