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

NeoRadio to tailwindcss #8543

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
32 changes: 6 additions & 26 deletions libs/ui/src/components/NeoRadio/NeoRadioButton.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<div class="control neo-radio-button" :class="{ 'is-expanded': expanded }">
<div class="neo-radio-button">
<label
ref="label"
class="button"
:class="labelClass"
:disabled="disabledNull"
@click="focus">
Expand All @@ -11,6 +10,7 @@
ref="input"
v-model="computedValue"
type="radio"
class="hidden"
:disabled="disabled"
:required="required"
:name="name"
Expand All @@ -33,7 +33,6 @@ export default {
type: String,
default: 'is-primary',
},
expanded: Boolean,
rounded: Boolean,
},
data() {
Expand Down Expand Up @@ -68,36 +67,17 @@ export default {
}
</script>

<style lang="scss">
@import '../../scss/_theme.scss';
@import '../../scss/variable.scss';

<style lang="scss" scoped>
.neo-radio-button {
input[type='radio'] {
display: none;
}

label {
display: flex;
align-items: center;
justify-content: center;

&.button {
text-transform: capitalize;
@include ktheme() {
border-color: theme('background-color-inverse');
}
}
@apply flex items-center justify-center text-base/normal h-10 rounded py-button-y px-button-x bg-background-color cursor-pointer capitalize border-default border-background-color-inverse;

&.is-selected {
@include ktheme() {
color: theme('text-color-inverse');
background-color: theme('background-color-inverse');
}
@apply text-text-color-inverse bg-background-color-inverse;
}

&.is-rounded {
border-radius: $radius-rounded;
@apply rounded-full;
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions libs/ui/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ module.exports = {
'icon-spin':
'icon-spin infinite linear var(--oruga-icon-spin-duration, 1.5s)',
},
padding: {
'button-x': 'calc(0.75em - 1px)',
'button-y': 'calc(0.5em - 1px)',
},
},
},
plugins: [],
Expand Down
Loading