GithubHelp home page GithubHelp logo

campaignmonitor / shell Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 4.0 938 KB

Campaign Monitor's CSS library

License: MIT License

CSS 79.44% JavaScript 10.76% HTML 9.79%
campaign-monitor css css-library sass

shell's People

Contributors

chris-pearce avatar daveordead avatar davidberner avatar williamtsoi1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shell's Issues

New Grid modifiers

There's a need to add modifiers at the individual grid item level with the most common treatment being different alignments options using flex-self. Also making all grid item children equal height.

Remove spinner from `number` input type

This may be the CSS to use but make sure it's properly checked:

input[type='number'] {
    appearance: textfield;
}

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button,
input[type='number']:hover::-webkit-inner-spin-button,
input[type='number']:hover::-webkit-outer-spin-button {
    appearance: none;
}

Questionable rule in Normalise/Reset

This rule in Normalise/Reset removes some of OS X's native styling:

Remove rounded corners that iOS applies to all `<input>` buttons and certain
browsers e.g. Chrome, apply rounded corners to `<select>`s.

With the rule:

screen shot 2016-02-24 at 3 55 58 pm

Without the rule:

screen shot 2016-02-24 at 3 55 50 pm

Create version 1

  • Prepare npm module
  • Set up git tagging
  • Create CHANGELOG.md
  • Create CONTRIBUTING.md
  • Update README.md
  • Update .npmignore
  • #17

12 col grid item CSS missing from Grid

It got added as a setting in _settings.scss but not in _grid.scss 😢.

Should come after:

// 11 col
.l-grid__item--11-col {
    width: $shell-grid-11-col-width;
}

// Apply at breakpoints
@if $shell-grid-apply-11-col-width-at-breakpoints {
    @include apply-at-breakpoints(".l-grid__item--11-col", $shell-grid-define-11-col-width-breakpoints) {
        width: $shell-grid-11-col-width;
    }
}

Search inputs not normalised the same as other textual inputs

type="search" has a different border style than the rest of the textual inputs, see:

screen shot 2016-02-26 at 1 47 42 pm

Most likely due to this, which is needed to remove aggressive user-agent styles:

screen shot 2016-02-26 at 1 48 18 pm

This can be dealt with quite easy in the project styles, or it could be something we add to Normalise/Reset?

Consider making the Base link styles into a mixin

It's a common UI pattern to have a <button> look like the default text link e.g. a Button Link component.

Making such a component means you have to copy the CSS for the default text link: https://github.com/campaignmonitor/shell/blob/master/src/_base.scss#L46-L58 which obviously isn't DRY.

Converting the default text link to a mixin will make things DRY as you can then just do this in your Button Link component:

.c-button-link {
    @include base-link;
}

Meaning there's only one source of truth.

Apply Campaign Monitor CSS conventions via Stylelint, and update Stylelint

When this happens review all stylelint disable/enable comments, e.g.

@mixin hidpi-bg-img($img-url, $img-width: auto, $img-height: auto) {
    /* stylelint-disable */
    @media (min-resolution: $shell-g-hidpi-dppx),
           (min-resolution: $shell-g-hidpi-dpi) {
    /* stylelint-enable */
        background-image: url('#{$img-url}');
        background-size: $img-width $img-height;
    }
}

Make sure to update the config file and remove stylelint_config.js.

Add a new Helper to remove responsive images

This is currently in _base.scss -> Images:

/**
 * Third-party widgets—like Google Maps—cannot have their images be responsive
 * as this breaks any images used within them therefore we remove that by
 * applying the two possible Google Map container selectors plus a generic
 * container selector to be used for other third-party widgets.
 *
 * N.B. it is okay to use `!important` here as we're doing it pre-emptively
 * i.e. you know you will always want the rule it's applied to to take
 * precedence.
 */

/* stylelint-disable */

.remove-responsive-images img,
#map_canvas img,
.map_canvas img {
    max-width: none !important;
}

/* stylelint-enable */

It should be in _helpers.scss.

Remove `l-side-by-side`

This layout module doesn't seem to give us anything we can't achieve with a 2 column grid.

Investigate and remove it if above concern is valid

Focus styles

I think this:

:focus
{
    /* normalized default styles for all browsers */
    outline: currentColor dotted thin;
    /* on webkit and blink use focus ring;
       style of “auto” hides it, when using mouse or touch */
    outline: -webkit-focus-ring-color auto 5px;
    /*
    if one don't like webkit's ring, use this instead:
    @supports (outline-color: -webkit-focus-ring-color)
    {
        :focus { outline-style: auto; }
    }
    */
}
/* don't use outline on mozilla browsers, if it's not needed */
:focus:not(:-moz-focusring)
{
    outline: none;
}

Should live in Base or Normalise/Reset.

Add a new "Spacing none" helper

I found this is needed, something like:

.h-spacing-none {
    margin-bottom: 0 !important;
}

Can be added to the existing Spacing section in _helpers.scss.

Export `scss` libraries via object props

It would be great if we could expose all of shell's libraries via an npm entry js.

For example:

var shell = require('./src/shell.scss');
var settings = require('./src/_settings.scss');

module.exports = {
  settings: settings,
  shell: shell,
  ...
};

This would allow npm modules (and webpack) to consume either the whole scss lib or just relevant libraries.

Set up CI

CI Tasks
When a PR is pushed to the Shell repo
  • Passes all CSS linting rules (could use Gulp).
  • Sass compiles (currently a Grunt command exists: grunt testShell, in the test/ folder).
  • Versioning:
    • Grab the version from the .version file and apply it to the "version" object key in the package.json file.
    • Create a git tag: git tag -a vX -m "Version X" where "X" is the version number pulled from the .version file.
When a PR is merged to the master branch
  • Run npm publish.
  • Run git push origin [tagname].

Travis is a good option I think: https://travis-ci.org/.

Grid > Negative bottom margin bug

Steps to reproduce:

  • create component with 2 col grid inside (no modifiers).
  • put placeholder content in the cells
    • Put background colour on wrapping component to help visualise bug
  • create another 2 col grid beneath this with a heading in one of the cells.

You will see the second grid has been pulled up under the first so the heading is cut in half.

Variable naming discrepancy

I've started using shell in a few projects now, and one of the things I've come across that threw me was the different naming variants for scales. (the base keyword on spacing for example)

Example:

$shell-g-font-size-heading-small
$shell-g-font-size-heading
$shell-g-font-size-heading-large

$shell-g-spacing-small
$shell-g-spacing-base
$shell-g-spacing-large

$shell-container-maximum-width-small
$shell-container-maximum-width
$shell-container-maximum-width-large

I'm used to the difference now, but I imagine new adopters will find this annoying too as the spacing variable is the only scale that includes the base word.

Why the f*** is it not compiling?!

  • Me

Disclaimer: I may not use shell in the way it was designed to be used. I never use any of the scaling helper classes. If i need to scale an element (either font-size, font-weight, padding, margin etc) that element will be part of a module, and so I'll be using the SASS variable $shell-g-font-size-heading-large rather than the heading heading--large helper classes.

Remove base naming convention from Shell's settings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.