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

Component: @phase2/outline-core-styled-text #432

Draft
wants to merge 25 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cacbe0e
feat: Roughs out file structure.
JSchreff Jan 30, 2024
f33da2e
feat: wip, more component roughed out.
JSchreff Jan 30, 2024
aca9cd0
feat: adds utilities.
JSchreff Jan 30, 2024
e2406ef
chore: kneel before the gods of lint.
JSchreff Jan 30, 2024
8a5e1df
feat: updates of various flavors, but the build is still broken
JSchreff Jan 30, 2024
30df13d
feat: Storybook now loads something.
JSchreff Jan 30, 2024
f453c22
Merge branch 'next' into issue/NT-outline-core-styled-text
JSchreff Feb 6, 2024
f27c19a
feat: Update story to specify cke5
JSchreff Feb 6, 2024
91ba853
feat: Wip updates to ckeditor.
JSchreff Feb 13, 2024
4d26634
Merge branch 'next' into issue/NT-outline-core-styled-text
JSchreff Feb 13, 2024
4551222
feat: Story now works, component is ready for development.
JSchreff Feb 13, 2024
f728da1
feat: Update story style.
JSchreff Feb 13, 2024
8635f40
Merge branch 'next' into issue/NT-outline-core-styled-text
JSchreff Feb 20, 2024
c4f96cd
Updates tooltip
JSchreff Feb 20, 2024
77c7ba7
Updates dependencies.
JSchreff Feb 20, 2024
9255cf5
Updates storybook import so it, you know, works.
JSchreff Feb 20, 2024
be61b4a
Updates CSS. We'll begin slowly processing new css into our new format.
JSchreff Feb 20, 2024
a06ceb0
Creates starterkit.
JSchreff Feb 20, 2024
5c78eff
css vars games.
JSchreff Feb 20, 2024
c7826e4
vars update.
JSchreff Feb 27, 2024
fae1eea
Updates vars file.
JSchreff Feb 27, 2024
8d389fd
Look Mr. Frodo, more vars updates.
JSchreff Feb 27, 2024
845db03
Look mr. frodo, more updates.
JSchreff Feb 27, 2024
5e9f9b3
Merge branch 'next' into issue/NT-outline-core-styled-text
JSchreff Feb 27, 2024
b3cf30a
Blocked on tooling.
JSchreff Feb 27, 2024
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

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions packages/components/outline-core-styled-text/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @file Exports for the OutlineCoreStyledText component.
*
* Any export here is then available via the following import,
* which should be available in the consuming application:
*
* @code
* import { OutlineCoreStyledText } from '@phase2/outline-core-styled-text';
* import { constantOne, constantTwo } from '@phase2/outline-core-styled-text';
* import type { ThingType } from '@phase2/outline-core-styled-text';
* @endcode
*
* Any of the above exports can be used in the consuming application
* based on the contents of this file, and creativity of what functionality
* you wish to expose to the consuming application(s).
*/

// Export the primary component.
export { OutlineCoreStyledText } from './src/outline-core-styled-text';

// Export any additional sub-components, variables and methods as required.
39 changes: 39 additions & 0 deletions packages/components/outline-core-styled-text/packages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@phase2/outline-core-styled-text",
"private": true,
"version": "0.0.1",
"description": "The Outline Components for the styled text component",
"keywords": [
"outline",
"web-components",
"design system",
"image",
"picture"
],
"main": "index.ts",
"types": "index.ts",
"typings": "index.d.ts",
"files": ["/dist/", "/src/", "!/dist/tsconfig.build.tsbuildinfo"],
"author": "Phase2 Technology",
"repository": {
"type": "git",
"url": "https://github.com/phase2/outline.git",
"directory": "packages/outline-core-styled-text"
},
"homepage": "https://github.com/phase2/outline/tree/next/packages/components/outline-core-styled-text",
"license": "BSD-3-Clause",
"scripts": {
"build": "node ../../../scripts/build.js",
"package": "yarn publish"
},
"dependencies": {
"@phase2/outline-core": "^0.2.5",
"lit": "^2.3.1"
},
"publishConfig": {
"access": "public"
},
"exports": {
".": "./index.ts"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
* All CSS selectors/rules in this file will be nested within `.ck.ck-content {` due to the name of this file.
*
* This file brings in all the necessary CSS for the WYSIWYG elements and restricts its influence to the `.ck.ck-content` selector.
* The lightDOM controller accomplishes this by extracting the file name before .global.css and creating a new stylesheet called .ck.ck-content.global.scoped.css,
* which contains the CSS specifically scoped to that selector.
*
* Subsequently, .ck.ck-content.global.scoped.css is imported into /project/design/src/ckeditor5.css, along with the
* design system tokens, and is then built into the theme. The resulting built file is the one that gets included on pages that have CKEditor.
*
* See https://www.drupal.org/node/3259165
* See https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html#sharing-content-styles-between-frontend-and-backend
**/

/** Import Tokens.
* Scope the css variables so they do not conflict with Drupal Admin theme's CSS variables.
*/
/* @import '@phase2/outline-core-tokens/dist/tokens.default.css';
@import '../../../../outline.theme.css';

@import '../outline-core-heading/outline-core-heading.css';
@import '../outline-core-button/outline-core-button.css';
@import '../outline-core-cta/outline-core-cta.css';
@import '../outline-core-cta/outline-core-cta.shared.css';
@import '../outline-core-link/outline-core-link.css';
@import '../outline-core-tooltip/outline-core-tooltip.shared.css';*/
@import './outline-core-styled-text.shared.css';

/**
* Reset to :host rules that are set in:
* `@import '../outline-core-button/outline-core-button.css';` that affects ckeditor width.
* `@import '../outline-core-heading/outline-core-heading.css';` affect font-weight and color.
*/
:host {
color: var(--outline-core-text-color);
display: block;
font-weight: unset;
width: unset;

@screen sm {
width: unset;
}
}

/* Override for tooltip styles. */
/* a.sic-tooltip {
text-decoration: underline;

&::after {
content: '';
display: inline-block;
margin-left: calc(var(--spacing-01));
margin-bottom: -0.1em;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
height: var(--sic-link--icon-size, 0.8em);
width: var(--sic-link--icon-size, 0.8em);
background-image: var(
--sic-tooltip--icon,
url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23004ea8" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/></svg>')
);
}
} */

Large diffs are not rendered by default.

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:host {
/* Support floats. */
display: block;
font-family: var(--ff-display);
font-weight: inherit;
color: var(--sic-text-color);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* Rendered WYSIWYG content is wrapped in <outline-core-styled-text> on the frontend. */
/* WYSIWYG content is wrapped in .ck-content for targeting within CKEditor. */
/* See https://www.drupal.org/node/3259165 */

outline-core-styled-text {
/* Support floats. */
display: block;
font-family: var(--ff-display);
font-weight: var(--fw-normal);
color: var(--outline-core-text-color);

@nested-import './outline-core-styled-text.shared.css';
@nested-import './outline-core-table.css';
@nested-import '../outline-core-cta/outline-core-cta.shared.css';
/* @nested-import '../outline-core-tooltip/outline-core-tooltip.shared.css'; */

/* @screen queries not handled correctly by nested-import, so manually added. */
/* Add margin-bottom to top-level ul and ol only. */
& > ul,
& > ol {
margin-bottom: 1.5em;
padding-left: var(--spacing-05);

ul,
ol {
padding-left: var(--spacing-05);

@screen sm {
padding-left: var(--spacing-06);
}
@screen md {
padding-left: var(--spacing-08);
}
@screen lg {
padding-left: var(--spacing-12);
}
}
}
}
Loading
Loading