Skip to content

Commit

Permalink
align-self and align now override CSS properties instead of CSS varia…
Browse files Browse the repository at this point in the history
…bles; this is important because that keeps the alignment classes utility-first and overrides the w-* and h-* classes because they are specified after. Technically the w-* and h-* classes can be specified elsewhere but they are tightly coupled for now.
  • Loading branch information
Zaydek Michels-Gualtieri committed Dec 20, 2020
1 parent f0ff6c6 commit 1c6cc69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/runtime/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ const Duomo: IRuntime = {

if (mode !== "production") {
const handleKeyDownDarkMode = (e: KeyboardEvent) => {
if (!e.ctrlKey && (e.key.toLowerCase() === "d" || e.keyCode === 68)) {
if (e.ctrlKey && (e.key.toLowerCase() === "d" || e.keyCode === 68)) {
Duomo.toggleDarkMode()
}
}
document.addEventListener("keydown", handleKeyDownDarkMode)
deferers.push(() => document.removeEventListener("keydown", handleKeyDownDarkMode))

const handleKeyDownDebugMode = (e: KeyboardEvent) => {
if (e.ctrlKey && (e.key.toLowerCase() === "d" || e.keyCode === 68)) {
if (!e.ctrlKey && (e.key.toLowerCase() === "d" || e.keyCode === 68)) {
Duomo.toggleDebugMode()
}
}
Expand Down
1 change: 0 additions & 1 deletion src/sass/core/grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
@if matches($v, core) {
.grid {
display: grid;
align-self: var(--dm-align-self);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/sass/extensions/stacks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $-align-opts: (
flex-direction: row;
justify-content: center;
align-self: var(--dm-align-self);
align-items: var(--dm-align);
align-items: center;
min-width: min-content; // Needed for `overflow-x-scroll`
}

Expand Down Expand Up @@ -103,7 +103,7 @@ $-align-opts: (
flex-direction: column;
justify-content: center;
align-self: var(--dm-align-self);
align-items: var(--dm-align);
align-items: center;
min-width: auto; // Needed for `overflow-x-scroll`
}

Expand Down Expand Up @@ -213,7 +213,7 @@ $-align-opts: (

@each $mk, $mv in $-align-self-opts {
#{variant($mk, $v)} {
--dm-align-self: #{$mv};
align-self: #{$mv};
}
}

Expand All @@ -223,7 +223,7 @@ $-align-opts: (

@each $mk, $mv in $-align-opts {
#{variant($mk, $v)} {
--dm-align: #{$mv};
align-items: #{$mv};
}
}

Expand Down

0 comments on commit 1c6cc69

Please sign in to comment.