Skip to content

Commit

Permalink
Prepare main to hold code for next major version (#1599)
Browse files Browse the repository at this point in the history
* Adding pre mode

* Updating the workflows

* Update README.md

* Create proud-rules-wonder.md

* Rename and move color mode variables out of base package (#1462)

* Rename and move color mode variables out of base package

* Create mighty-goats-teach.md

* Add test to make sure support is never more than 0

* Update mighty-goats-teach.md

* Update mighty-goats-teach.md

* Remove test

* Delete patch

* Moving color modes to their own bundle (#1465)

* Moving color modes to their own bundle

* Create new-beers-peel.md

* Removing the rem() mixin and usages. Placing the computed values in place. (#1541)

* Removing the rem() mixin and usages. Placing the computed values in place.

* Create flat-shirts-lay.md

* Fixing stylelint issues

* Fix more stylelint issue

* Remove break-word from utilities (#1566)

* Remove break-word from utilities

* Create twelve-fireants-shave.md

* Adding dark high contrast

* Fixing mising color modes selectors

* Remove pre.json if it exists

* Fixing lint error

* Removing pre mode

Co-authored-by: simurai <[email protected]>
  • Loading branch information
jonrohan and simurai authored Sep 17, 2021
1 parent 2892525 commit 13de16c
Show file tree
Hide file tree
Showing 19 changed files with 76 additions and 63 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-shirts-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": major
---

Removing the rem() mixin and usages. Placing the computed values in place.
5 changes: 5 additions & 0 deletions .changeset/mighty-goats-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": major
---

Rename `modes.scss` file to `color-modes.scss` and move from the `base/` folder to the `support/variables` folder.
5 changes: 5 additions & 0 deletions .changeset/new-beers-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": major
---

Moving color modes to their own bundle, `./color-modes/` and separates color mode themes into their own scss file.
5 changes: 5 additions & 0 deletions .changeset/twelve-fireants-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": major
---

Remove break-word from utilities
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- 'main'
- 'next_major'
jobs:
release:
name: Final
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release_canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches-ignore:
- 'main'
- 'changeset-release/main'
- 'changeset-release/**'
- 'dependabot/**'
# Don't release canary when these paths change
# It's not necessary because we don't ship them and it creates noise
Expand Down Expand Up @@ -50,6 +50,7 @@ jobs:
run: |
echo "$( jq '.version = "0.0.0"' package.json )" > package.json
echo -e "---\n'@primer/css': patch\n---\n\nFake entry to force publishing" > .changeset/force-snapshot-release.md
rm -f .changeset/pre.json
yarn changeset version --snapshot
yarn changeset publish --tag canary
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release
on:
push:
branches:
- 'changeset-release/main'
- 'changeset-release/**'

jobs:
release-candidate:
Expand Down
1 change: 0 additions & 1 deletion src/base/index.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import "../support/index.scss";

@import "./normalize.scss";
@import "./modes.scss";
@import "./base.scss";
@import "./kbd.scss";
@import "./typography-base.scss";
Expand Down
41 changes: 0 additions & 41 deletions src/base/modes.scss

This file was deleted.

7 changes: 7 additions & 0 deletions src/color-modes/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// All themes

@import "./themes/light.scss";
@import "./themes/dark.scss";
@import "./themes/dark_dimmed.scss";
@import "./themes/dark_high_contrast.scss";
@import "./native.scss";
10 changes: 10 additions & 0 deletions src/color-modes/native.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// color-scheme
// Enables color modes for native elements

@include color-mode(light) { color-scheme: light; }
@include color-mode(dark) { color-scheme: dark; }

[data-color-mode] {
color: var(--color-fg-default);
background-color: var(--color-canvas-default);
}
7 changes: 7 additions & 0 deletions src/color-modes/themes/dark.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import "../../support/index.scss";

@import "@primer/primitives/dist/scss/colors/_dark.scss";

@include color-mode-theme(dark) {
@include primer-colors-dark;
}
7 changes: 7 additions & 0 deletions src/color-modes/themes/dark_dimmed.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import "../../support/index.scss";

@import "@primer/primitives/dist/scss/colors/_dark_dimmed.scss";

@include color-mode-theme(dark_dimmed) {
@include primer-colors-dark_dimmed;
}
7 changes: 7 additions & 0 deletions src/color-modes/themes/dark_high_contrast.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import "../../support/index.scss";

@import "@primer/primitives/dist/scss/colors/_dark_high_contrast.scss";

@include color-mode-theme(dark_high_contrast) {
@include primer-colors-dark_high_contrast;
}
7 changes: 7 additions & 0 deletions src/color-modes/themes/light.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import "../../support/index.scss";

@import "@primer/primitives/dist/scss/colors/_light.scss";

@include color-mode-theme(light, true) {
@include primer-colors-light;
}
3 changes: 3 additions & 0 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
// Imports all Primer files in their intended order for easy mass-inclusion.
// Should you need specific files, you can easily use separate `@import`s.

// CSS color variables
@import "./color-modes/index.scss";

// Global requirements
@import "./core/index.scss";
@import "./product/index.scss";
Expand Down
8 changes: 4 additions & 4 deletions src/marketing/buttons/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
display: inline-block;
appearance: none !important;
// stylelint-disable-next-line primer/spacing
padding: rem(($spacer-3) * 0.9) rem($spacer-4) rem(($spacer-3) * 1.1);
padding: 0.9rem 1.5rem 1.1rem;
// stylelint-disable-next-line primer/typography
font-size: 1rem;
font-weight: $font-weight-bold;
Expand All @@ -14,7 +14,7 @@
user-select: none;
border: 0;
// stylelint-disable-next-line primer/borders
border-radius: rem(6px);
border-radius: 0.375rem;

@include btn-solid-mktg(
var(--color-mktg-btn-text),
Expand All @@ -34,7 +34,7 @@
z-index: -1;
content: "";
// stylelint-disable-next-line primer/borders
border-radius: rem(6px);
border-radius: 0.375rem;
opacity: 0;
transition: opacity 0.4s;
}
Expand Down Expand Up @@ -97,7 +97,7 @@

.btn-small-mktg {
// stylelint-disable-next-line primer/spacing
padding: rem(10px) rem($spacer-3) rem(13px);
padding: 0.625rem 1rem 0.8125rem;
}

.btn-large-mktg {
Expand Down
14 changes: 0 additions & 14 deletions src/marketing/support/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,3 @@
opacity: 0.5;
}
}

$browser-context: 16 !default;

@function rem($pixels, $context: $browser-context) {
@if (unitless($pixels)) {
$pixels: $pixels * 1px;
}

@if (unitless($context)) {
$context: $context * 1px;
}

@return $pixels / $context * 1rem;
}
1 change: 0 additions & 1 deletion src/utilities/typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@
.ws-normal { white-space: normal !important; }

/* Force long "words" to wrap if they exceed the width of the container */
.break-word, // deprecated
.wb-break-word {
word-break: break-word !important;
// this is for backwards compatibility with browsers that don't respect overflow-wrap
Expand Down

0 comments on commit 13de16c

Please sign in to comment.