File tree Expand file tree Collapse file tree 9 files changed +1638
-3134
lines changed
Expand file tree Collapse file tree 9 files changed +1638
-3134
lines changed Original file line number Diff line number Diff line change 88 src : url ('/assets-2usdf/fonts/Urbanist-VariableFont_wght.ttf' ) format ("truetype" );
99}
1010
11- body {
12- font-family : 'Urbanist' , sans-serif;
13- }
14-
1511@theme {
16- /* todo: think about only removing specific utility classes */
1712 -- * : initial;
1813
1914 --color-black : # 101010 ;
2015
2116 --color-brand-300 : # 6482EC ;
17+ --color-brand-500 : # 1E46D6 ;
18+ --color-brand-700 : # 172F81 ;
2219
2320 --color-white : # FAFAFA ;
2421 --color-gray-100 : # D6D6D6 ;
@@ -32,15 +29,13 @@ body {
3229 --spacing-sm : .375rem ; /* 6px */
3330 --spacing-md : .5rem ; /* 8px */
3431 --spacing-lg : .75rem ; /* 12px */
35-
36- --text-sm : .875rem ; /* 14px */
37- --text-sm--line-height : 1.25rem ; /* 20px */
38-
32+ --spacing-xl : 1rem ; /* 16px */
33+ --spacing-3xl : 1.5rem ; /* 24px */
34+
35+ --text-sm-tight : .875rem ; /* 14px */
36+ --text-sm-tight--line-height : 1rem ; /* 16px */
37+ /* --text-sm: .875rem; 14px */
38+ /* --text-sm--line-height: 1.25rem; 20px */
39+ --text-md : 1rem ; /* 16px */
40+ --text-md--line-height : 1.5rem ; /* 24px */
3941}
40- /* todo: think about moving this to theme.css (problem import order) */
41- @theme inline {
42- /* --color-brand-100: var(--color-gray-100); */
43-
44- /* --color-link-100: var(--color-gray-100); */
45- }
46-
Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- const { variant = ' primary' } = defineProps <{
3- variant? : ' primary' | ' secondary' ,
2+ import { LazyBaseIcon } from ' #components'
3+ import type { IconName } from ' ~/layers/base/app/components/BaseIcon.vue'
4+
5+ const {
6+ size = ' md' ,
7+ variant = ' primary' ,
8+ } = defineProps <{
9+ leadingIcon? : IconName ,
10+ size? : ' md' | ' xl' ,
11+ trailingIcon? : IconName ,
12+ variant? : ' branded' | ' primary' ,
413}>()
514 </script >
615
716<template >
817 <button
9- class =" bg-linear-to-b py-md px-sm rounded-full text-sm font-semibold opacity-90 hover:opacity-95 disabled:opacity-40 aria-disabled:opacity-40 active:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-300"
18+ class =" flex items-center bg-linear-to-b rounded-full font-semibold disabled:opacity-40 aria-disabled:opacity-40 active:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-300"
1019 :class =" [
11- variant === 'primary' && 'from-gray-100 to-gray-300 text-black',
20+ variant === 'primary' && 'from-gray-100 to-gray-300 text-black opacity-90 hover:opacity-95',
21+ variant === 'branded' && 'from-brand-500 to-brand-700 text-white hover:opacity-90',
22+ size === 'md' && 'text-sm-tight py-md px-sm',
23+ size === 'xl' && 'text-md py-xl px-3xl',
1224 ]"
1325 >
26+ <LazyBaseIcon
27+ v-if =" leadingIcon"
28+ :name =" leadingIcon"
29+ class =" "
30+ />
1431 <span class =" px-lg" >
1532 <slot />
1633 </span >
34+ <LazyBaseIcon
35+ v-if =" trailingIcon"
36+ :name =" trailingIcon"
37+ class =" "
38+ />
1739 </button >
1840</template >
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type icons from ' @iconify-json/tabler/icons.json'
3+
4+ export type IconName = keyof typeof icons [' icons' ]
5+
6+ const { name } = defineProps <{
7+ name: IconName ,
8+ }>()
9+
10+ // https://github.com/nuxt/icon?tab=readme-ov-file#icon-customization
11+ const customize = (content : string ) => {
12+ return content
13+ .replace (/ stroke-width="[^ "] * "/ g , ' stroke-width="1.5px"' )
14+ }
15+ </script >
16+
17+ <template >
18+ <Icon
19+ :name =" `tabler:${name}`"
20+ :customize
21+ />
22+ </template >
Original file line number Diff line number Diff line change 11<script setup lang="ts"></script >
22
33<template >
4- <div class =" font-urbanist" >
4+ <div class =" font-urbanist antialiased " >
55 <slot />
66 </div >
77</template >
Original file line number Diff line number Diff line change 66 <NuxtLayout name =" base" >
77 Primary Button
88 <section class =" grid gap-sm" >
9+ <div >
10+ <BaseButton
11+ leading-icon =" file-code-2"
12+ trailing-icon =" arrow-up-right"
13+ size =" xl"
14+ variant =" branded"
15+ >
16+ Go to API
17+ </BaseButton >
18+ </div >
919 <div >
1020 <BaseButton
1121 variant =" primary"
Original file line number Diff line number Diff line change @@ -7,11 +7,20 @@ import tailwindcss from '@tailwindcss/vite'
77const currentDir = dirname ( fileURLToPath ( import . meta. url ) )
88
99export default defineNuxtConfig ( {
10+ /* eslint-disable perfectionist/sort-objects -- as there is a conflict with `nuxt specific eslint rules` */
11+ modules : [ '@nuxt/icon' ] ,
1012 $meta : {
1113 name : 'base' ,
1214 } ,
1315 css : [ join ( currentDir , './app/assets/css/main.css' ) ] ,
1416 vite : {
1517 plugins : [ tailwindcss ( ) ] ,
1618 } ,
19+ icon : {
20+ mode : 'css' ,
21+ cssLayer : 'base' ,
22+ size : '1.25rem' ,
23+ localApiEndpoint : '/api/bff/_nuxt_icon' ,
24+ } ,
25+ /* eslint-enable perfectionist/sort-objects */
1726} )
Original file line number Diff line number Diff line change 33 "@tailwindcss/vite" : " ^4.1.12" ,
44 "tailwindcss" : " ^4.1.12"
55 },
6+ "devDependencies" : {
7+ "@iconify-json/tabler" : " ^1.2.22" ,
8+ "@nuxt/icon" : " ^2.0.0"
9+ },
610 "name" : " beaconchain-explorer-base" ,
711 "private" : true ,
812 "type" : " module"
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type { RouteLocationNormalizedLoaded } from 'vue-router'
33export default function ( {
44 name,
55 params,
6+ path,
67} : RouteLocationNormalizedLoaded ) {
78 const { has } = useFeatureFlag ( )
89 const config = useRuntimeConfig ( )
@@ -62,4 +63,8 @@ export default function ({
6263 case 'validator-id' :
6364 return redirectToV1 ( `/validator/${ params . id || params . slug ?. [ 1 ] } ` )
6465 }
66+ const currentEnvironment = config . public . deploymentType
67+ if ( currentEnvironment === 'production' && path . startsWith ( '/playground' ) ) {
68+ return abortNavigation ( )
69+ }
6570}
You can’t perform that action at this time.
0 commit comments