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

Use Codex tokens and custom spacing variables #750

Closed
Closed
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
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ <h1>New Lexeme</h1>
import DevLexemeCreator from './src/data-access/DevLexemeCreator';
import DevLangCodeRetriever from './src/data-access/DevLangCodeRetriever';
import LanguageItemSearcher from './src/data-access/LanguageItemSearcher';
import '@wikimedia/codex/dist/codex.style.css';
import '@wikimedia/codex-design-tokens/theme-wikimedia-ui.css';

const config = {
rootSelector: '#app',
Expand Down
152 changes: 152 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"node": ">=16"
},
"dependencies": {
"@wikimedia/codex": "^1.12.0",
"@wikimedia/codex-design-tokens": "^1.12.0",
"@wmde/wikibase-datamodel-types": "^0.2.0",
"@wmde/wikit-tokens": "^3.0.0-alpha.12",
"@wmde/wikit-vue-components": "^3.0.0-alpha.12",
Expand Down
4 changes: 3 additions & 1 deletion src/components/AnonymousEditWarning.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ const warning = computed(
</template>

<style lang="scss" scoped>
@import '@/styles/custom-variables.css';
.wbl-snl-anonymous-edit-warning {
margin: 1rem 0;
margin: var( --dimension-layout-xsmall ) 0;
}
</style>
4 changes: 2 additions & 2 deletions src/components/LanguageInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ export default {
</template>

<style lang="scss">
@import '@wmde/wikit-tokens/variables';
@import '@wikimedia/codex-design-tokens/theme-wikimedia-ui';
/* stylelint-disable selector-class-pattern */
.wbl-snl-language-lookup .wikit .wikit-Lookup__label-wrapper {
gap: $dimension-spacing-xsmall;
gap: $spacing-50;
}
/* stylelint-enable selector-class-pattern */
Expand Down
4 changes: 2 additions & 2 deletions src/components/LemmaInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ export default {
</template>

<style lang="scss">
@import '@wmde/wikit-tokens/variables';
@import '@wikimedia/codex-design-tokens/theme-wikimedia-ui';
/* stylelint-disable plugin/stylelint-bem-namics, selector-class-pattern */
.wbl-snl-lemma-input.wikit .wikit-TextInput__label-wrapper {
gap: $dimension-spacing-xsmall;
gap: $spacing-50;
}
/* stylelint-enable plugin/stylelint-bem-namics, selector-class-pattern */
</style>
4 changes: 2 additions & 2 deletions src/components/LexicalCategoryInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ export default {
</template>

<style lang="scss">
@import '@wmde/wikit-tokens/variables';
@import '@wikimedia/codex-design-tokens/theme-wikimedia-ui';
/* stylelint-disable selector-class-pattern */
.wbl-snl-lexical-category-lookup .wikit .wikit-Lookup__label-wrapper {
gap: $dimension-spacing-xsmall;
gap: $spacing-50;
}
/* stylelint-enable selector-class-pattern */
Expand Down
36 changes: 18 additions & 18 deletions src/components/NewLexemeForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ref,
} from 'vue';
import { useStore } from 'vuex';
import { Button as WikitButton } from '@wmde/wikit-vue-components';
import { CdxButton } from '@wikimedia/codex';
import { useConfig } from '@/plugins/ConfigPlugin/Config';
import { useMessages } from '@/plugins/MessagesPlugin/Messages';
import LemmaInput from '@/components/LemmaInput.vue';
Expand Down Expand Up @@ -176,45 +176,45 @@ export default {
<span v-html="error" />
</error-message>
<div>
<wikit-button
<cdx-button
class="form-button-submit"
type="progressive"
variant="primary"
native-type="submit"
action="progressive"
weight="primary"
type="submit"
:disabled="submitting"
>
{{ submitButtonText }}
</wikit-button>
</cdx-button>
</div>
</form>
</template>

<style scoped lang="scss">
@import '@wmde/wikit-tokens/variables';
@import '@wmde/wikit-vue-components/src/styles/mixins/Typography';
@import '@/styles/custom-variables.css';
@import '@wikimedia/codex-design-tokens/theme-wikimedia-ui';

.wbl-snl-form {
& > * + * {
margin-top: $dimension-layout-xsmall;
margin-top: var( --dimension-layout-xsmall );
}

// Box model
padding: $dimension-layout-small;
padding: var( --dimension-layout-xsmall );

// Border
border-style: $border-style-base;
border-width: $border-width-thin;
border-width: $border-width-base;
border-radius: $border-radius-base;
border-color: $border-color-base-subtle;
border-color: $border-color-muted;
}

.wbl-snl-copyright {
@include small-text;

font-size: 0.8125rem;
font-style: italic;
font-synthesis: none;
margin-bottom: 0;
/* codex Body S */
font-family: $font-family-system-sans;
font-size: $font-size-small;
font-weight: $font-weight-normal;
line-height: $line-height-medium;
color: $color-base;
}

</style>
8 changes: 4 additions & 4 deletions src/components/RequiredAsterisk.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ export default {
</template>

<style lang="scss" scoped>
@import '@wmde/wikit-tokens/variables';
@import '@wikimedia/codex-design-tokens/theme-wikimedia-ui';

.wbl-snl-required-asterisk {
font-size: $font-size-xxlarge;
font-size: $font-size-xx-large;
line-height: 0;

&:not( :first-child ) {
margin-inline-start: $dimension-spacing-small;
margin-inline-start: $spacing-50;
}

&:not( :last-child ) {
margin-inline-end: $dimension-spacing-small;
margin-inline-end: $spacing-50;
}
}
</style>
16 changes: 11 additions & 5 deletions src/components/SearchExisting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ const searchMessage = computed( () => messages.get(
</template>

<style lang="scss" scoped>
@import '@wmde/wikit-tokens/variables';
@import '@wmde/wikit-vue-components/src/styles/mixins/Typography';
@import '@/styles/custom-variables.css';
@import '@wikimedia/codex-design-tokens/theme-wikimedia-ui';
.wbl-snl-search-existing {
@include body;
/* font Codex Body */
font-family: $font-family-system-sans;
font-size: $font-size-medium;
font-weight: $font-weight-normal;
line-height: $line-height-medium;
color: $color-base;
margin-top: 1rem;
margin-bottom: 1rem;
/* margins */
margin-top: var( --dimension-layout-xsmall );
margin-bottom: var( --dimension-layout-xsmall );
}
</style>
6 changes: 3 additions & 3 deletions src/components/SpellingVariantInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,17 @@ export default {
</template>

<style lang="scss">
@import '@wmde/wikit-tokens/variables';
@import '@wikimedia/codex-design-tokens/theme-wikimedia-ui';
.wbl-snl-spelling-variant-lookup {
/* stylelint-disable plugin/stylelint-bem-namics, selector-class-pattern */
&.wikit .wikit-Lookup__label-wrapper {
gap: $dimension-spacing-xsmall;
gap: $spacing-50;
}
/* stylelint-enable plugin/stylelint-bem-namics, selector-class-pattern */
&__help-link {
padding-bottom: $wikit-Label-padding-block-end;
padding-bottom: $spacing-50;
display: inline-block;
}
}
Expand Down
Loading
Loading