1
1
mirror of https://github.com/primer/css.git synced 2024-12-26 15:43:59 +03:00

Prepare main to hold code for next major version (#1599)

* 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 <simurai@github.com>
This commit is contained in:
Jon Rohan 2021-09-16 18:20:07 -07:00 committed by GitHub
parent 289252583f
commit 13de16c7d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 76 additions and 63 deletions

View File

@ -0,0 +1,5 @@
---
"@primer/css": major
---
Removing the rem() mixin and usages. Placing the computed values in place.

View File

@ -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.

View File

@ -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.

View File

@ -0,0 +1,5 @@
---
"@primer/css": major
---
Remove break-word from utilities

View File

@ -3,6 +3,7 @@ on:
push:
branches:
- 'main'
- 'next_major'
jobs:
release:
name: Final

View File

@ -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
@ -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:

View File

@ -2,7 +2,7 @@ name: Release
on:
push:
branches:
- 'changeset-release/main'
- 'changeset-release/**'
jobs:
release-candidate:

View File

@ -1,7 +1,6 @@
@import "../support/index.scss";
@import "./normalize.scss";
@import "./modes.scss";
@import "./base.scss";
@import "./kbd.scss";
@import "./typography-base.scss";

View File

@ -1,41 +0,0 @@
// Color modes
@import "../support/mixins/color-modes.scss";
@import "@primer/primitives/dist/scss/colors/_light.scss";
@import "@primer/primitives/dist/scss/colors/_dark.scss";
@import "@primer/primitives/dist/scss/colors/_dark_dimmed.scss";
@import "@primer/primitives/dist/scss/colors/_dark_high_contrast.scss";
// Outputs the CSS variables
// Use :root (html element) to define a default
@include color-mode-theme(light, true) {
@include primer-colors-light;
}
@include color-mode-theme(dark) {
@include primer-colors-dark;
}
@include color-mode-theme(dark_dimmed) {
@include primer-colors-dark_dimmed;
}
@include color-mode-theme(dark_high_contrast) {
@include primer-colors-dark_high_contrast;
}
// Color mode boundaries
// Enables nesting of different color modes
[data-color-mode] {
color: var(--color-fg-default);
background-color: var(--color-canvas-default);
}
// color-scheme
// Enables color modes for native elements
@include color-mode(light) { color-scheme: light; }
@include color-mode(dark) { color-scheme: dark; }

View File

@ -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";

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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";

View File

@ -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;
@ -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),
@ -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;
}
@ -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 {

View File

@ -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;
}

View File

@ -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