Skip to content

Commit

Permalink
Merge pull request #51 from mozdevs/organize
Browse files Browse the repository at this point in the history
Attempt to organize an initial release
  • Loading branch information
mirisuzanne authored Sep 10, 2019
2 parents f8351e6 + d4609ba commit fda341a
Show file tree
Hide file tree
Showing 7 changed files with 197 additions and 98 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog & Release Notes

## v0.1.0 - unreleased

- Organize the existing proposed & discussed remedies into three categories:
- Universally recommended remedies in `remedy.css`
- Optional remedies worth considering in `reminders.css`
- Specialized remedies (such as `quotes.css`) in their own files
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing to CSS Remedy

We'd love to have you contribute to this project.
You can get involved by
[creating or commenting on an issue](https://github.com/mozdevs/cssremedy/issues).

This repository is governed by Mozilla's code of conduct and etiquette guidelines. For more details, please read the [Mozilla Community Participation Guidelines](https://www.mozilla.org/en-US/about/governance/policies/participation/).

## Pull Reguests

We're also happy to take pull requests,
both for fixing bugs/typos
and submitting new remedies.
For larger changes,
it's often best to file an issue for discussion first.

The code is organized into:

- A core `remedy.css` that we recommend using broadly across most projects.
- A secondary `reminders.css` with more opinionated or situational remedies that should be reviewed and considered on a case-by-case basis.
- Additional specialized remedy files (such as `quotes.css`) that can be used as-needed, but may not be required generally.

The `process` folder contains related materials:

- Other resets
- UA stylesheets from various browsers
- An html file to test against
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,50 @@
# CSS Remedy

Start your project with a remedy for the technical debt of CSS.
A gift to you from Mozilla Developer Outreach.
Start your project with a remedy for the technical debt of CSS.
A gift to you from Mozilla Developer Relations.

_This project is just getting started. It's too early to distribute it as part of other frameworks. Feel free to read the files and take inspiration, but do know we have a ways to go before it's really "ready to use"._


## Contribute

We'd love to have you contribute to this project. [Create or comment on an issue](https://github.com/mozdevs/cssremedy/issues).
We'd love to have you contribute to this project.
See the [contributing guidelines](CONTRIBUTING.md) for more detail.


## What Is This?
## What Is This?

For years, base or reset stylesheets have helped web developers get started faster.
For years, base or reset stylesheets have helped web developers get started faster.

Early resets eliminated all visual styling, putting the burden of defining styles for every element on the webmaster. This made sense when there weren't as many elements or properties, and when each browser did something very different than the others. By zeroing everything out, you start from a blank page. There were many reset stylesheets that took this approach. Eric Meyer's became the most popular.
Early resets eliminated all visual styling, putting the burden of defining styles for every element on the webmaster. This made sense when there weren't as many elements or properties, and when each browser did something very different than the others. By zeroing everything out, you start from a blank page. There were many reset stylesheets that took this approach. Eric Meyer's became the most popular.

More recently, Normalize and similar projects took a different approach. Rather than removing all styling, they set out to create sensible defaults and eliminate browser bugs. Use one of these and you get a consistent base across all browsers.

CSS Remedy takes a slightly different approach. These days, browsers are far more consistent in how they render CSS. But there are limitations on how far browsers can improve their User Agent Stylesheet. The defaults for the web have to be consistent with the past. Many desirable changes would break millions of existing websites.
CSS Remedy takes a slightly different approach. These days, browsers are far more consistent in how they render CSS. But there are limitations on how far browsers can improve their User Agent Stylesheet. The defaults for the web have to be consistent with the past. Many desirable changes would break millions of existing websites.

You, however, don't have to stay in the past. You can override the UA styles with more modern ideas of how CSS should work by default. Introducing CSS Remedy.
You, however, don't have to stay in the past. You can override the UA styles with more modern ideas of how CSS should work by default. Introducing CSS Remedy.


> ### “‘Because that’s what Mosaic did’ is exactly the kind of reasoning CSS Remedy is trying to leave behind.” — Eric Meyer
## Guiding Ideas

CSS Remedy...
* Sets CSS properties or values to what they would be if the CSSWG were creating the CSS today, from scratch, and didn't have to worry about backwards compatibility.
* Applies basic styling to form elements and controls, getting you started with custom styling. We want to find the balance between providing a base for implementing a custom design, and allowing OS-level control over how form inputs work (like how a number pad works on iOS).
* Provides a very lightweight starter file, with generic visual styling that you will want to replace. This isn't as robust or opinionated as a starter-theme or framework. We've leaned toward specifying less, so you have less to override. (We haven't defined any font families, for example.)
CSS Remedy sets CSS properties or values to what they would be if the CSSWG were creating the CSS today, from scratch, and didn't have to worry about backwards compatibility.

We provide:
- A core `remedy.css` that we recommend using broadly across most projects.
- A secondary `reminders.css` with more opinionated or situational remedies that should be reviewed and considered on a case-by-case basis.
- Additional specialized remedy files (such as `quotes.css`) that can be used as-needed, but may not be required generally.

The current set of features can be extended along those lines, with opportunities for light-weight form-styling and other useful defaults. This is a living project, and we're excited to see where it goes!

## Browser Support

We will actively support modern browers, IE 11 and up. For older browsers:

- We will add proven fixes when they are light-weight and non-invasive. We're not trying to ensure full interoperability, but we do want to help encourage reasonable fallbacks.
- We won't "support" older browsers with any sense of urgency, priority, or completeness.
- We're not trying to polyfill new CSS features like grid, or recreate the full html5 "shiv"

## Inspiration and History

Expand Down
File renamed without changes.
11 changes: 6 additions & 5 deletions process/Tester/test.html → process/test/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

<script type="text/javascript" src="styleswitcher.js"></script>

<link rel="stylesheet" type="text/css" href="../4_reset.css" title="Reset" />
<link rel="alternate stylesheet" type="text/css" href="../research/others/2012_normalize.css" title="Normalize" />
<link rel="alternate stylesheet" type="text/css" href="../research/others/2011_reset.css" title="Reset" />
<link rel="alternate stylesheet" type="text/css" href="../research/others/2017_reboot.scss" title="Reboot" />

<link rel="stylesheet" type="text/css" href="../../remedy.css" title="Remedy Core" />
<link rel="stylesheet" type="text/css" href="../../reminders.css" title="Remedy Reminders" />
<link rel="alternate stylesheet" type="text/css" href="../other_resets/2012_normalize.css" title="Normalize" />
<link rel="alternate stylesheet" type="text/css" href="../other_resets/2011_reset.css" title="Reset" />
<link rel="alternate stylesheet" type="text/css" href="../other_resets/2017_reboot.scss" title="Reboot" />

<title>HTML5 Test Page</title>
</head>
<body>
Expand Down
154 changes: 73 additions & 81 deletions remedy.css
Original file line number Diff line number Diff line change
@@ -1,107 +1,99 @@
/* Global Remedies
******************/

/* Use border-box by default, globally */
*, ::before, ::after { box-sizing: border-box; }

/* This project is under construction. It's not ready for release yet. As of Feb 11, 2019. */

/*
* 1. Consistent line spacing...
* CSS Inline Layout Module Level 3: https://drafts.csswg.org/css-inline-3/#line-sizing-property
* 2. Improve spacing of punctuation marks and script changes in CJK languages
* CSS Text Module Level 4: https://drafts.csswg.org/css-text-4/#text-spacing-property
*/
html {
line-sizing: normal;
text-spacing: trim-start allow-end trim-adjacent ideograph-alpha ideograph-numeric;
}

/* Remove the tiny space around the edge of the page */
body { margin: 0; }

*, ::before, ::after { box-sizing: border-box; } /* Switch to border-box for box-sizing. */

/* Immediately jump any animation to the end point if the user has set their device to "prefers reduced motion". */
/* This could create bad, unintended consequences. Remove as needed, and write your own appropriate code for prefers-reduced-motion. */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.001s !important;
transition-duration: 0.001s !important;
animation-iteration-count: 1 !important;
}
}
/* Headings
***********/

body {
margin: 0; /* Remove the tiny space around the edge of the page */
}
/* Switch to rem units for headings */
/* @@@ Initial values are based on existing browser defaults */
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.17rem; }
h4 { font-size: 1.00rem; }
h5 { font-size: 0.83rem; }
h6 { font-size: 0.67rem; }

/* Switch to using rem units for typography. Fix line-height on headlines. */
h1 {
font-size: 2rem; /* Make all of the H1 tags large, remove nested-shrinking sizes. */
margin: 0.67em 0;
}
h2 {
font-size: 1.5rem;
}
h3 {
font-size: 1.17rem;
}
h4 {
font-size: 1.00rem;
}
h5 {
font-size: 0.83rem;
}
h6 {
font-size: 0.67rem;
}
/* Keep h1 margins consistent, even when nested */
h1 { margin: 0.67em 0; }

h2, h3, h4, h5, h6{
line-height: 1;
}

/* Improve readability */
p, ul, ol, dl, address {
line-height: 1.5;
}
/* Typography
*************/

/* Overflow by default is bad */
pre { white-space: pre-wrap; }

pre {
white-space: pre-wrap; /* Overflow by default is bad. */
}
/* Solid, thin horizonatal rules */
hr { border: 0.5px solid; }

hr {
border: .5px solid;
}

/* Embedded Elements
********************/

/* Are browsers now consistent with margin & padding on lists?
See: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Lists_and_Counters/Consistent_list_indentation */
nav ul {
list-style: none;
}
/* Add zero-width-space to prevent VoiceOver disable
See: https://unfetteredthoughts.net/2017/09/26/voiceover-and-list-style-type-none/ */
nav li:before {
content: "\200B";
/*
* 1. Block display is usually what we want
* 2. Remove strange space-below when inline
* 3. Responsive by default
*/
img, svg, video, canvas, audio, iframe, embed, object {
display: block;
vertical-align: middle;
max-width: 100%;
}

img, video, canvas, audio, iframe, embed, object {
display: block; /* Switch display mode to block, since that's what we usually want for images. */
vertical-align: middle; /* If you override, and make an image inline, it's likely you'll want middle vertical alignment. */
}
img, video {
max-width: 100%; /* Make images and video flexible by default. */
height: auto; /* Ensure images and video maintain their aspect ratio when max-width comes into play. */
}
img {
border-style: none; /* Remove the border on images inside links in IE 10 and earlier. */
/*
* Maintain intrinsic aspect ratios when `max-width` is applied
* (iframe, embed, and object have no intrinsic ratio, set height explicitly)
*/
img, svg, video, canvas {
height: auto;
}

/* In English, when styling the <q> element, use curly quotes instead of straight quotes. */

/* Code for this is now in the quotes.css file */
/*
* There is no good reason elements default to 300px,
* and audio files are unlikely to come with a width attribute
*/
audio { width: 100%; }


/* Old Browsers
***************/

/* Remove the border on images inside links in IE 10 and earlier */
img { border-style: none; }

/* Support upcoming properties that haven't been broadly implemented yet,
but for which the initial value and legacy behavior is not be the best behavior.
*/
/* Hide the overflow in IE 10 and earlier */
svg { overflow: hidden; }

/* Consistent line spacing, which does not unnecessarily grow to accommodate things that would fit anyway */
/* From CSS Inline Layout Module Level 3: https://drafts.csswg.org/css-inline-3/#line-sizing-property */
:root {
line-sizing: normal;
/* Default block display on HTML5 elements */
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
display: block;
}

/* Improve spacing of punctuation marks and at script changes in CJK languages */
/* From CSS Text Module Level 4: https://drafts.csswg.org/css-text-4/#text-spacing-property */
:root {
text-spacing: trim-start allow-end trim-adjacent ideograph-alpha ideograph-numeric;
/*
* 1. Add the correct box sizing in IE 10
* 2. Remove the padding in IE 10
*/
[type='checkbox'],
[type='radio'] {
box-sizing: border-box;
padding: 0;
}
60 changes: 60 additions & 0 deletions reminders.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* These are not universally recommended remedies,
* but they are good to consider,
* and they might work for you.
*/


/* Nav Lists
************/

/*
* List styling is not usually desired in navigation,
* but this also removes list-semantics for screen-readers
* See: https://github.com/mozdevs/cssremedy/issues/15
*/
nav ul {
list-style: none;
}

/*
* 1. Add zero-width-space to prevent VoiceOver disable
* 2. Absolute position ensures no extra space
* See: https://unfetteredthoughts.net/2017/09/26/voiceover-and-list-style-type-none/
*/
nav li:before {
content: "\200B";
position: absolute;
}


/* Reduced Motion
*****************/

/*
* 1. Immediately jump any animation to the end point
* 2. Remove transitions & fixed background attachment
* See: https://github.com/mozdevs/cssremedy/issues/11
*/
@media (prefers-reduced-motion: reduce) {
*, ::before, ::after {
animation-delay: -1s !important;
animation-duration: 1s !important;
animation-iteration-count: 1 !important;
background-attachment: initial !important;
transition-duration: 0s !important;
}
}


/* Line Heights
***************/

/*
* The default `normal` line-height is tightly spaced, but takes font-metrics into account.
* Looser spacing may improve readability, but may cause problems in some scripts.
* See: https://github.com/mozdevs/cssremedy/issues/7
*/
html { line-height: 1.5; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; }
caption, figcaption, label, legend { line-height: 1.375; }

0 comments on commit fda341a

Please sign in to comment.