Skip to content

Commit

Permalink
Renamed generate-colors-from-map to generate-opaque-colors-from-map b…
Browse files Browse the repository at this point in the history
…ecause of alpha channel
  • Loading branch information
Zaydek Michels-Gualtieri committed Nov 16, 2020
1 parent 8eeccdc commit 55bff93
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/duomo/core/background-color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@mixin background-color-from-map($map, $opacity-range) {
// prettier-ignore
@include helpers.generate-colors-from-map(
@include helpers.generate-opaque-colors-from-map(
"bg",
background-color,
$map,
Expand Down
2 changes: 1 addition & 1 deletion src/duomo/core/border.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// TODO: Rename to `generate-opaque-colors-from-map`.
@mixin border-color-from-map($map, $opacity-range) {
// prettier-ignore
@include helpers.generate-colors-from-map(
@include helpers.generate-opaque-colors-from-map(
"border",
border-color,
$map,
Expand Down
2 changes: 1 addition & 1 deletion src/duomo/core/color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@mixin color-from-map($map, $opacity-range) {
// prettier-ignore
@include helpers.generate-colors-from-map(
@include helpers.generate-opaque-colors-from-map(
"text",
color,
$map,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $color-map: (
);
@at-root {
@include generate-colors-from-map(
@include generate-opaque-colors-from-map(
$shorthand: "text",
$prop: color,
$map: $color-map,
Expand Down
2 changes: 1 addition & 1 deletion src/duomo/helpers/generators.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
}

@mixin generate-colors-from-map($shorthand, $prop, $map, $opacity-range) {
@mixin generate-opaque-colors-from-map($shorthand, $prop, $map, $opacity-range) {
$amp: get-ampersand();

@each $k, $v in $map {
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/AspectRatio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ interface AspectRatioProps extends React.ComponentProps<"div"> {
export default function AspectRatio({ aspectRatio, children, ...props }: AspectRatioProps) {
return (
// prettier-ignore
<div className="relative" style={{ paddingBottom: (1 / aspectRatio) * 100 + "%" }} {...props}>
<div className="absolute y-0 x-0">
<div className="relative" style={{ paddingBottom: 1 / aspectRatio * 100 + "%" }} {...props}>
<div className="absolute x-0 y-0">
{children}
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/runtime/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Ex:
//
// rem(16) -> 1rem
export function rem(n: number): number | string {
const floored = Math.floor(n)
export function rem(px: number): number | string {
const floored = Math.floor(px)
if (!floored) {
return 0
}
Expand All @@ -12,8 +12,8 @@ export function rem(n: number): number | string {
// Ex:
//
// em(16) -> 1em
export function em(n: number): number | string {
const floored = Math.floor(n)
export function em(px: number): number | string {
const floored = Math.floor(px)
if (!floored) {
return 0
}
Expand All @@ -23,8 +23,8 @@ export function em(n: number): number | string {
// Ex:
//
// px(16) -> 16px
export function px(n: number): number | string {
const floored = Math.floor(n)
export function px(px: number): number | string {
const floored = Math.floor(px)
if (!floored) {
return 0
}
Expand Down

0 comments on commit 55bff93

Please sign in to comment.