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

Merge recent updates from dev to main #18

Merged
merged 8 commits into from
Oct 18, 2024
Merged
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: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,27 @@ yarn add @cosmicds/vue-toolkit

If you're doing development work on these components, it will likely be useful to have an external sample project that imports a development version of this one. The easiest way to do this is probably to use [`npm-link`](https://docs.npmjs.com/cli/v10/commands/npm-link). For example:
```
cd <path-where-you-keep-this-repo>
cd <path-where-you-keep-the-toolkit-repo>

# build the package
yarn
yarn build

# set up link to local development version
npm link
cd <path-to-your-sample-repo>
npm link @cosmicds/vue-toolkit

# To make local changes to the toolkit active, you have to rebuild the package after every change.
# Tip from @johnarban: This will take you to the previous directory you were in, which makes it easier to toggle between folders
cd -

# to unlink when you are done (Note - order is important here)

cd <path-to-your-sample-repo> # if you're not already there
npm unlink --no-save @cosmicds/vue-toolkit

cd <path-where-you-keep-the-toolkit-repo>
npm unlink

```
5 changes: 5 additions & 0 deletions src/components/CreditLogos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:href="logo.href"
target="_blank"
rel="noopener noreferrer"
class="logo-link"
>
<img
:alt="logo.alt"
Expand Down Expand Up @@ -69,6 +70,10 @@ const cssVars = computed(() => {

img {
height: var(--logo-size);
margin-inline: 0.1em;
}
}
.logo-link {
display: inline-flex;
}
</style>
12 changes: 4 additions & 8 deletions src/components/IconButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ import { IconButtonProps } from "../types";
const props = withDefaults(defineProps<IconButtonProps>(), {
color: "#ffffff",
focusColor: "#ffffff",
activeColor: "#ffffff",
backgroundColor: "#040404",
boxShadow: true,
border: true,
longPressTimeMs: 500,
tooltipLocation: "start",
Expand Down Expand Up @@ -84,8 +84,7 @@ const cssVars = computed(() => {
"--color": props.color,
"--background-color": props.backgroundColor,
"--focus-color": props.focusColor,
"--active-shadow": props.boxShadow ? props.color : "transparent",
"--focus-shadow": props.boxShadow ? props.focusColor : "transparent",
"--active-color": props.activeColor,
};
});

Expand Down Expand Up @@ -142,11 +141,8 @@ function handleTouchEnd() {
}

&.active {
box-shadow: 0px 0px 10px 3px var(--active-shadow);

&:focus {
box-shadow: 0px 0px 10px 3px var(--focus-shadow);
}
color: var(--active-color);
border-color: var(--active-color);
}
}
</style>
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ export interface IconButtonProps {
color?: string;
/** The color of the button when focused. Default is white */
focusColor?: string;
/** The color of the button when active. Default is white */
activeColor?: string;
/** The background color of the button. Default is #040404 */
backgroundColor?: string;
/** Whether to use a box shadow when the button is active. Default is true */
boxShadow?: boolean;
/** Whether the button has a border. Default is true */
border?: boolean;
/** The time duration, in ms, to recognize a press event as a long press. Default is 500 */
Expand Down
Loading