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

[Globals] Defining breakpoints in site.variables in a custom packaged theme not building #1003

Closed
trandromeda opened this issue Sep 6, 2019 · 3 comments
Assignees
Labels
type/build Anything related to the build process
Milestone

Comments

@trandromeda
Copy link

trandromeda commented Sep 6, 2019

Bug Report

Steps to reproduce

  1. Create a custom packaged theme by making a new folder under themes e.g. semantic/src/themes/mycustomtheme
  2. Create mycustomtheme/globals/site.variables
  3. Add your own breakpoints e.g.
@mobileBreakpoint            : 320px;
@tabletBreakpoint            : 958px;
@computerBreakpoint          : 1182px;
@largeMonitorBreakpoint      : 1360px;
@widescreenMonitorBreakpoint : 1920px;
  1. In theme.config, specify Globals: @site to use the custom theme e.g. @site : 'mycustomtheme';
  2. Run gulp build

Expected result

Site should use new breakpoint values

Actual result

Site ignores breakpoint values in custom theme's site.variables, instead uses the values of the last theme that was specified in Globals: @site.

Testcase

(unable to demonstrate this in a jsfiddle)
You can replicate using this simple UI to view different breakpoint behaviours (cards span full width under tablet size):

<div class="ui four column grid stackable cards">
  <div class="ui fluid card">
  A card
  </div>
    <div class="ui fluid card">
  A card
  </div>
    <div class="ui fluid card">
  A card
  </div>
    <div class="ui fluid card">
  A card
  </div>
    <div class="ui fluid card">
  A card
  </div>
    <div class="ui fluid card">
  A card
  </div>
</div>
  • setting another one of the pre-packaged themes in Globals: @site, such as Github or Amazon, will correctly set the breakpoints
  • custom breakpoints work when setting them in the Site Theme
  • if making changes to site.variables of the custom theme, gulp watch will not be triggered

Version

2.7.8

@trandromeda trandromeda changed the title [Globals] Setting breakpoints in site.variables in a custom packaged theme not building [Globals] Defining breakpoints in site.variables in a custom packaged theme not building Sep 6, 2019
@trandromeda
Copy link
Author

trandromeda commented Sep 6, 2019

I just found this in tasks/build/css.js:223:

      if(path.indexOf('site.variables') !== -1)  {
        return;
      } 

So any changes to a site.variables file is ignored and not built... that would explain why my custom theme globals for site.variables were not being used. From this, it seems the intent of the author was to enforce usage of site globals only to the Site Theme ...? It confused me that the Github, Amazon and Material themes had a Globals/site.variables file, so I was thinking I could do the same for a custom theme. Would appreciate some clarification on this matter, thanks!

@exoego exoego added the type/build Anything related to the build process label Oct 1, 2019
@exoego
Copy link
Contributor

exoego commented Oct 1, 2019

@ColinFrick
Could you see this when you have time ?
I think you have expertise in build tools.

@ColinFrick
Copy link
Member

I'll look into it.

@ColinFrick ColinFrick self-assigned this Oct 2, 2019
@ColinFrick ColinFrick added the state/has-pr An issue which has a related PR open label Oct 2, 2019
@lubber-de lubber-de added tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build and removed state/has-pr An issue which has a related PR open labels Nov 12, 2019
@lubber-de lubber-de added this to the 2.8.1 milestone Nov 12, 2019
@y0hami y0hami closed this as completed in 4d3f3e4 Nov 14, 2019
@y0hami y0hami removed the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/build Anything related to the build process
Projects
None yet
Development

No branches or pull requests

5 participants