-
Notifications
You must be signed in to change notification settings - Fork 3
POC: feat: stable style for AtomLabelEditForm
#75
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
Merged
tpoisseau
merged 10 commits into
main
from
72-ensure-stable-styling-accross-integrations
Dec 19, 2025
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c17cc1e
feat: add OclReset and improves form css
tpoisseau 2610a2b
chore: simplify useCSS
tpoisseau c1e06c4
chore: add OclReset export
tpoisseau 218066c
refactor: use `<style>` instead
tpoisseau 23e9e1d
feat: improve DX with `CSS_template_literal.xml`
tpoisseau 99fb207
refactor: move reset in stories
tpoisseau b154ad1
refactor: custom `InlineStylesheet` id
tpoisseau 4326868
feat: AtomLabelEditForm migrate to emotion
tpoisseau 4dc18a2
refactor: remove styling helpers
tpoisseau ab54cff
chore: remove is-prop-valid because it's not needed
tpoisseau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <LanguageInjectionConfiguration> | ||
| <injection language="CSS" injector-id="js"> | ||
| <display-name>CSS template literal</display-name> | ||
| <single-file value="true" /> | ||
| <place><![CDATA[taggedString("css")]]></place> | ||
| <templateTag>css</templateTag> | ||
| </injection> | ||
| </LanguageInjectionConfiguration> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| import isPropValid from '@emotion/is-prop-valid'; | ||
| import styled from '@emotion/styled'; | ||
|
|
||
| export const greekLetters = { | ||
| alpha: 'α', | ||
| beta: 'β', | ||
| gamma: 'γ', | ||
| delta: 'δ', | ||
| epsilon: 'ε', | ||
| zeta: 'ζ', | ||
| eta: 'η', | ||
| theta: 'θ', | ||
| } as const; | ||
| const greekLetterNames = Object.keys(greekLetters); | ||
| const greeksFirstLine = greekLetterNames.slice(0, 6); | ||
| const greeksLastLine = greekLetterNames.slice(6); | ||
|
|
||
| export const primes = { | ||
| prime1: '′', | ||
| prime2: '″', | ||
| prime3: '‴', | ||
| }; | ||
| const primeNames = Object.keys(primes); | ||
|
|
||
| export const AtomLabelEditFormStyled = styled.form` | ||
| --box-size: 24px; | ||
|
|
||
| position: absolute; | ||
| z-index: 1; | ||
| line-height: 1; | ||
| font-size: 16px; | ||
| display: grid; | ||
| grid-template-columns: repeat(4, var(--box-size)); | ||
| grid-template-rows: repeat(3, var(--box-size)); | ||
| grid-template-areas: | ||
| 'input input input input submit cancel' | ||
| '${greeksFirstLine.join(' ')}' | ||
| '${greeksLastLine.join(' ')} . ${primeNames.join(' ')}'; | ||
| place-items: stretch; | ||
| gap: 0.25em; | ||
| border: 1px solid lightgray; | ||
| background-color: white; | ||
| padding: 0.25em; | ||
| box-sizing: border-box; | ||
| `; | ||
|
|
||
| export const AtomLabelEditInputStyled = styled.input` | ||
| grid-area: input; | ||
|
|
||
| padding: 0.25em; | ||
| border: solid 1px lightgrey; | ||
| border-radius: 3px; | ||
| font-family: sans-serif; | ||
| font-size: 13.3333px; | ||
|
|
||
| &:focus { | ||
| outline: auto; | ||
| } | ||
| `; | ||
|
|
||
| export const AtomLabelEditButtonStyled = styled('button', { | ||
| shouldForwardProp: (prop) => isPropValid(prop) && prop !== 'area', | ||
| })<{ area: string }>` | ||
tpoisseau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| grid-area: ${(props) => props.area}; | ||
|
|
||
| padding: 0.25em; | ||
| background-color: #efefef; | ||
| border: none; | ||
| border-radius: 5px; | ||
| font-family: sans-serif; | ||
| width: var(--box-size); | ||
| font-size: 13.3333px; | ||
| `; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { resetCss } from './ocl_reset_css.ts'; | ||
|
|
||
| // eslint-disable-next-line jsdoc/require-jsdoc | ||
| export function OclReset() { | ||
| return ( | ||
| <style href="react-ocl#Reset" precedence="medium"> | ||
| {resetCss} | ||
| </style> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.