Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add own class name hashing #220

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/tender-tomatoes-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"yak-swc": minor
"next-yak": minor
---

minify class names for production builds
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { styled, css } from "next-yak/internal";
import { colors, negative, siteMaxWidth } from "./constants";
import __styleYak from "./index.yak.module.css!=!./index?./index.yak.module.css";
import "./index.yak.module.css!=!./index?./index.yak.module.css";
export var Button = /*YAK Extracted CSS:
.Button {
// cssmodules-pure-ignore
:global(.Button_wIxfWW) {
color: red;
height: --yak-css-import: url("./constants:siteMaxWidth",mixin)px;
color: --yak-css-import: url("./constants:colors:primary",mixin);
background-color: --yak-css-import: url("./constants:colors:secondary",mixin);
z-index: --yak-css-import: url("./constants:negative",mixin);
}
.Button__ {
// cssmodules-pure-ignore
:global(.Button___wIxfWW) {
color: --yak-css-import: url("./constants:colors:secondary",mixin);
background-color: --yak-css-import: url("./constants:colors:primary",mixin);
}
*/ /*#__PURE__*/ styled.button(__styleYak.Button, function(param) {
*/ /*#__PURE__*/ styled.button("Button_wIxfWW", function(param) {
var $variant = param.$variant;
return $variant === "secondary" && /*#__PURE__*/ css(__styleYak.Button__);
return $variant === "secondary" && /*#__PURE__*/ css("Button___wIxfWW");
});
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.Button {
/* cssmodules-pure-ignore * /
:global(.Button_wIxfWW) {
color: red;
height: 10px;
color: var(--color-primary);
background-color: var(--color-secondary);
z-index: -1;
}
.Button__ {
/* cssmodules-pure-ignore * /
:global(.Button___wIxfWW) {
color: var(--color-secondary);
background-color: var(--color-primary);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { styled } from "next-yak/internal";
import { colors } from "./constants";
import __styleYak from "./index.yak.module.css!=!./index?./index.yak.module.css";
import "./index.yak.module.css!=!./index?./index.yak.module.css";
export var Button = /*YAK Extracted CSS:
.Button {
// cssmodules-pure-ignore
:global(.Button_bAtfrp) {
color: --yak-css-import: url("./constants:colors:primary",mixin);
background-color: --yak-css-import: url("./constants:colors:secondary",mixin);
}
*/ /*#__PURE__*/ styled.button(__styleYak.Button);
*/ /*#__PURE__*/ styled.button("Button_bAtfrp");
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.Button {
/* cssmodules-pure-ignore * /
:global(.Button_bAtfrp) {
color: var(--color-primary);
background-color: var(--color-secondary);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { styled } from "next-yak/internal";
import __styleYak from "./icon.yak.module.css!=!./icon?./icon.yak.module.css";
import "./icon.yak.module.css!=!./icon?./icon.yak.module.css";
export var Icon = /*YAK Extracted CSS:
.Icon {
// cssmodules-pure-ignore
:global(.Icon_je4Wtv) {
display: inline-block;
width: 20px;
height: 20px;
}
*/ /*#__PURE__*/ styled.span(__styleYak.Icon);
*/ /*#__PURE__*/ styled.span("Icon_je4Wtv");
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.Icon {
/* cssmodules-pure-ignore * /
:global(.Icon_je4Wtv) {
display: inline-block;
width: 20px;
height: 20px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { styled } from "next-yak/internal";
import { buttonMixin } from './mixin';
import { primaryButtonMixin } from './helper/anotherMixin';
import __styleYak from "./index.yak.module.css!=!./index?./index.yak.module.css";
import "./index.yak.module.css!=!./index?./index.yak.module.css";
export var Button = /*YAK Extracted CSS:
.Button {
// cssmodules-pure-ignore
:global(.Button_oPtJMe) {
--yak-css-import: url("./mixin:buttonMixin",mixin);
}
*/ /*#__PURE__*/ styled.button(__styleYak.Button);
*/ /*#__PURE__*/ styled.button("Button_oPtJMe");
export var PrimaryButton = /*YAK Extracted CSS:
.PrimaryButton {
// cssmodules-pure-ignore
:global(.PrimaryButton_oPtJMe) {
--yak-css-import: url("./helper/anotherMixin:primaryButtonMixin",mixin);
}
*/ /*#__PURE__*/ styled(Button)(__styleYak.PrimaryButton);
*/ /*#__PURE__*/ styled(Button)("PrimaryButton_oPtJMe");
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.Button {
/* cssmodules-pure-ignore * /
:global(.Button_oPtJMe) {
color: black;
:global(.icon_Icon__vdEsc) {
color: black;
}

}
.PrimaryButton {
/* cssmodules-pure-ignore * /
:global(.PrimaryButton_oPtJMe) {
color: black;
:global(.icon_Icon__vdEsc) {
color: black;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
import { styled, css } from "next-yak/internal";
import __styleYak from "./index.yak.module.css!=!./index?./index.yak.module.css";
import "./index.yak.module.css!=!./index?./index.yak.module.css";
var buttonTextMixin = /*#__PURE__*/ css(function(param) {
var $disabled = param.$disabled;
return $disabled && /*#__PURE__*/ css(__styleYak.buttonTextMixin__$disabled);
return $disabled && /*#__PURE__*/ css("buttonTextMixin__$disabled_xEUJ1U");
});
var Button = /*YAK Extracted CSS:
.Button {
// cssmodules-pure-ignore
:global(.Button_xEUJ1U) {
color: black;
}
.Button__$disabled {
// cssmodules-pure-ignore
:global(.Button__$disabled_xEUJ1U) {
opacity: 0.5;
}
.Button__$hasIcon {
// cssmodules-pure-ignore
:global(.Button__$hasIcon_xEUJ1U) {
padding-left: 30px;
}
.Button__$disabled-01 {
// cssmodules-pure-ignore
:global(.Button__$disabled_xEUJ1U-01) {
color: gray;
}
*/ /*#__PURE__*/ styled.button(__styleYak.Button, function(param) {
*/ /*#__PURE__*/ styled.button("Button_xEUJ1U", function(param) {
var $disabled = param.$disabled;
return $disabled && /*#__PURE__*/ css(__styleYak.Button__$disabled);
return $disabled && /*#__PURE__*/ css("Button__$disabled_xEUJ1U");
}, function(param) {
var $hasIcon = param.$hasIcon;
return $hasIcon && /*#__PURE__*/ css(__styleYak.Button__$hasIcon);
return $hasIcon && /*#__PURE__*/ css("Button__$hasIcon_xEUJ1U");
}, function(param) {
var $disabled = param.$disabled;
return $disabled && /*#__PURE__*/ css(__styleYak["Button__$disabled-01"]);
return $disabled && /*#__PURE__*/ css("Button__$disabled_xEUJ1U-01");
});
export default Button;
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
.Button {
/* cssmodules-pure-ignore * /
:global(.Button_xEUJ1U) {
color: black;
}
.Button__$disabled {
/* cssmodules-pure-ignore * /
:global(.Button__$disabled_xEUJ1U) {
opacity: 0.5;
}
.Button__$hasIcon {
/* cssmodules-pure-ignore * /
:global(.Button__$hasIcon_xEUJ1U) {
padding-left: 30px;
}
.Button__$disabled-01 {
/* cssmodules-pure-ignore * /
:global(.Button__$disabled_xEUJ1U-01) {
color: gray;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled } from "next-yak/internal";
import __styleYak from "./icon.yak.module.css!=!./icon?./icon.yak.module.css";
import "./icon.yak.module.css!=!./icon?./icon.yak.module.css";
export var Icon = /*#__PURE__*/ styled.svg();
export var AnyIcon = /*#__PURE__*/ styled.svg();
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { styled } from "next-yak/internal";
import { AnyIcon, Icon } from "./icon";
import __styleYak from "./index.yak.module.css!=!./index?./index.yak.module.css";
import "./index.yak.module.css!=!./index?./index.yak.module.css";
export var Button = /*YAK Extracted CSS:
.Button {
// cssmodules-pure-ignore
:global(.Button_JKqlji) {
--yak-css-import: url("./icon:Icon",selector) {
margin-right: 10px;
}
--yak-css-import: url("./icon:AnyIcon",selector) {
margin-right: 15px;
}
}
*/ /*#__PURE__*/ styled.button(__styleYak.Button);
*/ /*#__PURE__*/ styled.button("Button_JKqlji");
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.Button {
/* cssmodules-pure-ignore * /
:global(.Button_JKqlji) {
:global(.icon_Icon___yEni) {
margin-right: 10px;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { styled } from "next-yak/internal";
import { lastChildMixin } from './mixin';
import __styleYak from "./index.yak.module.css!=!./index?./index.yak.module.css";
import "./index.yak.module.css!=!./index?./index.yak.module.css";
var ListItem = /*YAK Extracted CSS:
.ListItem {
// cssmodules-pure-ignore
:global(.ListItem_PZqRtI) {
margin-bottom: 10px;
&:hover {
--yak-css-import: url("./mixin:lastChildMixin",mixin);
}
}
*/ /*#__PURE__*/ styled.li(__styleYak.ListItem);
*/ /*#__PURE__*/ styled.li("ListItem_PZqRtI");
export default ListItem;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.ListItem {
/* cssmodules-pure-ignore * /
:global(.ListItem_PZqRtI) {
margin-bottom: 10px;
&:hover {
&:last-child {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { styled } from "next-yak/internal";
import { siteMaxWidth } from "./constants.yak";
import __styleYak from "./index.yak.module.css!=!./index?./index.yak.module.css";
import "./index.yak.module.css!=!./index?./index.yak.module.css";
export var Button = /*YAK Extracted CSS:
.Button {
// cssmodules-pure-ignore
:global(.Button_Mx2s9f) {
color: red;
height: --yak-css-import: url("./constants.yak:siteMaxWidth",mixin)px;
}
*/ /*#__PURE__*/ styled.button(__styleYak.Button);
*/ /*#__PURE__*/ styled.button("Button_Mx2s9f");
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.Button {
/* cssmodules-pure-ignore * /
:global(.Button_Mx2s9f) {
color: red;
height: 10px;
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { styled } from "next-yak/internal";
import { typography } from "./typography.yak";
import __styleYak from "./index.yak.module.css!=!./index?./index.yak.module.css";
import "./index.yak.module.css!=!./index?./index.yak.module.css";
export var Headline = /*YAK Extracted CSS:
.Headline {
// cssmodules-pure-ignore
:global(.Headline_mxjUbw) {
color: red;
--yak-css-import: url("./typography.yak:typography:h1",mixin);
}
*/ /*#__PURE__*/ styled.button(__styleYak.Headline);
*/ /*#__PURE__*/ styled.button("Headline_mxjUbw");
export var Button = /*YAK Extracted CSS:
.Button {
// cssmodules-pure-ignore
:global(.Button_mxjUbw) {
color: red;
--yak-css-import: url("./typography.yak:typography:h3",mixin);
}
*/ /*#__PURE__*/ styled.button(__styleYak.Button);
*/ /*#__PURE__*/ styled.button("Button_mxjUbw");
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.Headline {
/* cssmodules-pure-ignore * /
:global(.Headline_mxjUbw) {
color: red;

font-family: "Roboto", sans-serif;
Expand All @@ -8,7 +9,8 @@
letter-spacing: 0.00938em;

}
.Button {
/* cssmodules-pure-ignore * /
:global(.Button_mxjUbw) {
color: red;

font-family: "Roboto", sans-serif;
Expand Down
Loading
Loading