Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Sass changes #50

Merged
merged 18 commits into from
Sep 14, 2017
Merged

Sass changes #50

merged 18 commits into from
Sep 14, 2017

Conversation

osk
Copy link
Contributor

@osk osk commented Sep 4, 2017

Changes to default Sass:

  • Add scaling css var and calc to responsive-font to deal with wide pages
  • Move hardcoded values to variables
  • Deprecate viewport mixin via @warn
  • Update $min-mobile breakpoint to 420 from 480
  • Update $page-width to 1290px
  • Rename (and deprecate old) grid mixins to grid-col etc
  • Add heading() subheading and copy() mixinstemplates

@birkir birkir temporarily deployed to starter-kit-universally-pr-50 September 4, 2017 11:40 Inactive
Copy link
Contributor

@organdonor47 organdonor47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe tidy that container mixin? added a comment on that.

also, we could add that weird dimensions breakpoint fix that we talked about & is in this PR - https://github.com/ueno-llc/ueno-www/pull/342 -
(will need to be documented & maybe even commented out by default?)

@@ -83,7 +97,7 @@
padding: 0 $container-gutter-mobile;
max-width: $page-width + $container-gutter-mobile * 1;
Copy link
Contributor

@organdonor47 organdonor47 Sep 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this mobile stuff in container doesn't really do anything; $page-width is always going to be greater than mobile viewports anyway and I am not sure why there are differences between the base size ($page-width + $container-gutter-mobile * 1) and min-mobile anyway?

also, there may be instances where we need to override top & bottom padding / margins, so this would be over-written at the next mq:

&__container {
    @include container;

    padding-top: percentage(50px/$page-limit);
    // overwritten at tablet to 0;
}

could left & right be explicitly declared as long-hand values rather than short-hand?

Like:

@mixin container() {
  margin-left: auto;
  margin-right: auto;
  padding-left: $container-gutter-mobile;
  padding-right: $container-gutter-mobile;

  @media (min-width: $min-tablet) {
    padding-left: $container-gutter-tablet;
    padding-right: $container-gutter-tablet;

    max-width: $page-width + $container-gutter-tablet * 2;
  }

  @media (min-width: $min-desktop) {
    padding-left: $container-gutter-desktop;
    padding-right: $container-gutter-desktop;

    max-width: $page-width + $container-gutter-desktop * 2;
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should definitely not use shorthand for padding.

@mixin make-row($direction: ltr, $align: stretch, $justify: flex-start, $grid-gutter: $gutter, $wrap: wrap) {
@warn 'make-row mixin is deprecated, use grid-row';
@include grid-row($direction, $align, $justify, $grid-gutter, $wrap);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do:

@mixin make-row($args...) {
  ...
  @include grid-row($args...);
}

@osk
Copy link
Contributor Author

osk commented Sep 4, 2017

Yeah, I had the scale thingie in mind. Has it been reviewed? Or should I just port it here and add to a page for easier review?

@organdonor47
Copy link
Contributor

yeah @osk maybe add in from that PR & we can test here instead -- not sure it needs to be implemented for ueno.co anyway (or at least there is no urgent need)

@bjarnif
Copy link
Collaborator

bjarnif commented Sep 4, 2017

It would be nice to add these to html {} in base.scss
-webkit-font-smoothing: antialiased; // stylelint-disable-line
-moz-osx-font-smoothing: grayscale; // stylelint-disable-line

@osk osk temporarily deployed to starter-kit-universally-pr-50 September 5, 2017 13:34 Inactive
@osk
Copy link
Contributor Author

osk commented Sep 5, 2017

I've updated according to comments.

@organdonor47 I'll add the scale experiment in a new branch after this one is merged.

@osk osk temporarily deployed to starter-kit-universally-pr-50 September 5, 2017 17:30 Inactive
@osk
Copy link
Contributor Author

osk commented Sep 5, 2017

On second thought, added a first version of scaling to responsive-font

margin-left: convertify($offset);
}

@mixin make-offset-right($offset: percentage(1/12)) {
@mixin grid-offset-right($offset: percentage(1/$grid-column-count)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the default $offset: just be 1 on lines 42 and 46? Because the percentage($number / $grid-column-count) is already getting applied via convertify($offset)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, since that's the expected behaviour when you're using it

@include reset-heading;
@include responsive-font($min, $max);

@warn 'Please implement for project';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does implement for project mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three mixins are included for those that want them. They have some settings that need to be changed for the project you're using them for, so this should trigger you to change them. But the wording is bad.

Please set values in this mixin for your project.?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, are these really that different than any other piece of the starter kit? Anything could be customized for a project if it needs to be, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but these values are arbitrary, like the 58 for margin, other values are based on $gutter or have some logic behind them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't have to be arbitrary, it could be based off something. Maybe even ($gutter * 2); or some other new variable.

Copy link
Contributor

@organdonor47 organdonor47 Sep 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k80 @osk i think if we add a variable there it could be mistaken for an integral non-editable part of the mixin though. an arbitrary value might look a bit messy, but at least it indicates a value you can edit? maybe we could have warnings in there to update those values and just have some kind of obvious placeholder value?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

123456789px would be obvious… and totally break the design.

@@ -83,17 +97,69 @@
padding: 0 $container-gutter-mobile;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also be long hand?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm not sure. Is there a case where we need to explicitly force it to be 0? @organdonor47 @mdmagnusson ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@osk @k80 yeh it should i think. no reason why it needs to be 0 top & bottom

font-family: $font-family;
font-weight: normal;
letter-spacing: 0;
line-height: (58/52);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this /52 supposed to be /$max? It is in the other 2.

@osk osk had a problem deploying to starter-kit-universally-pr-50 September 6, 2017 08:27 Failure
osk added 2 commits September 11, 2017 10:15
grid-offset-* default value 1 instead of 1/$grid-column-count
container mixin uses padding longhand
heading, subheading and copy mixins don't warn, just have explicitly
arbitrary values
@osk
Copy link
Contributor Author

osk commented Sep 11, 2017

@k80 @organdonor47
I removed the @warn from the mixins and set explicit $arbitrary-* variables instead it would always be changed, right? 😊

@osk
Copy link
Contributor Author

osk commented Sep 13, 2017

I'm merging this later today if there are no objections

@organdonor47
Copy link
Contributor

i think there is probably a more sensible solution to this down the line, but this is as good as any other alternative I can think of!

@osk osk merged commit 655d039 into development Sep 14, 2017
@osk osk deleted the feature/scss-changes branch September 14, 2017 09:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants