Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
21 changes: 21 additions & 0 deletions app/assets/css/mixins.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* mixin example */
@define-mixin text-underline $color {
&::after{
content: '';
display: block;
width: 0%;
height: 2px;

background-color: $color;
opacity: 0;

transition: width .3s var(--easing-authentic-motion), opacity .3s var(--easing-authentic-motion);
}

@media (--has-hover){
&:hover::after{
width: 100%;
opacity: 1;
}
}
}
27 changes: 22 additions & 5 deletions app/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<template>
<section class="page-home">
Home page here
<button @click="toggleMenu()" class="button">
Toggle menu - test mixin
</button>
<wp-image
v-for="(item, index) in items"
:key="index"
:image="item"
/>

<global-hamburger
:menu-opened="siteStore.menuOpened"
@toggle-menu="toggleMenu()"
/>

<div
v-html="data?.content"
Expand Down Expand Up @@ -48,8 +47,26 @@ const toggleMenu = () => {
</script>

<style scoped>
/* TODO: figure out how to import mixins globally */
@import "~/assets/css/mixins.css";

.page-home {
min-height: var(--unit-100vh);
min-height: 200vh;

color: var(--color-black);


.button{
@mixin text-underline var(--color-black);
}

/* margin: 0 auto; */
/* min-height: var(--unit-100vh); */

/* Hover states */
/* @media #{$has-hover} {
Hover styles would go here
} */

/* Hover */
@media (--has-hover) {
Expand Down
15 changes: 9 additions & 6 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ export default defineNuxtConfig({
},

// CSS and fonts
css: [
'~/assets/css/vars.css',
'~/assets/css/main.css',
'~/assets/css/transitions.css'
],
vue: {
// Required for @nuxtjs/storybook
runtimeCompiler: process.env.STORYBOOK === 'true'
Expand All @@ -60,6 +55,13 @@ export default defineNuxtConfig({
future: { compatibilityVersion: 4 },
compatibilityDate: '2024-09-17',

// CSS and fonts
css: [
'~/assets/css/vars.css',
'~/assets/css/main.css',
'~/assets/css/transitions.css',
'~/assets/css/mixins.css',
],
// Build configuration
nitro: {
routeRules: {
Expand Down Expand Up @@ -87,8 +89,9 @@ export default defineNuxtConfig({
postcss: {
plugins: {
'@csstools/postcss-global-data': {
files: ['./app/assets/css/media.css']
files: ['./app/assets/css/media.css', './app/assets/css/mixins.css']
},
'postcss-mixins': {},
'postcss-nested': {},
'postcss-custom-media': {}
}
Expand Down
100 changes: 100 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"pinia": "^2.1.7",
"postcss": "^8.4.47",
"postcss-custom-media": "^11.0.1",
"postcss-mixins": "^12.1.2",
"postcss-nested": "^6.2.0",
"prettier": "^3.3.3",
"storybook": "9.0.5",
Expand Down