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

[suggestion] more reliance on mixins, less on importing everything and making changes in variables file #2

Open
adamglenn opened this issue Mar 23, 2015 · 0 comments

Comments

@adamglenn
Copy link
Contributor

Would be a less confusing and would make lighter footprints in CSS code (for those not using every pattern) if blocks where implemented via just the mixins than with mixins + the variables.scss file.

For example instead of doing this to implement just the masthead:

@import 'wvu-patterns/0-plugins/plugins-dir';
@import 'wvu-patterns/1-base/base-dir';
@import 'wvu-patterns/2-modules/modules-dir';
@import 'wvu-patterns/3-layouts/layouts-dir';

wvu-patterns/1-base/_variables.scss : 
 $wvu-masthead-two-line-lockup: true;
 $wvu-masthead-has-signature: true;

we could do this instead:

@import 'wvu-patterns/1-base/wvu-masthead';
@include wvu-masthead-is-two-line-lockup(true);
@include wvu-masthead-has-signature(true);

By setting up your mixins to recognize inputs:

@mixin wvu-masthead-is-two-line-lockup( $mixin-var1: $wvu-masthead-two-line-lockup) {
  @if $mixin-var1 == true {
    .wvu-masthead__title { font-size: 0.75em; line-height: 1.08333333em; float: left; margin-top: 0.1em; }
    .wvu-masthead__university-name { top: 7.1em; }
  }
}

and by including any relevant variables or imports in the _wvu-masthead.scss file:

@import '../0-plugins/wvu-utilities/media-queries';

// Breakpoints
//==================================================

$bp-mini: 450;
$bp-small: 570;
$bp-medium: 768;
$bp-large: 960;
$bp-xlarge: 1200;
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

No branches or pull requests

1 participant