* chore: refactor config files to prevent migration tool errors * refactor: upgrade with the tailwind migration tool * chore: restore pre-commit command + mc * refactor(wip): update dependencies and migrate to Tailwind CSS v4 (mainly web) * chore: resolve Tailwind v4 migration conflicts from merging main * chore: remove unused Tailwind packages from config and update dependencies for v4 migration * chore: uncomment Tailwind CSS utility classes in globals.css * fix: resolve token conflicts between calcom and coss ui * fix: textarea scrollbar * Fix CUI-16 * fix: added @tailwindcss/forms plugin and cleaned up CSS classes in various components to remove unnecessary dark mode styles * fix: selects and inputs of different sizes * fix: remove unnecessary leading-20 class from modal titles in various components * fix: update Checkbox component styles to remove unnecessary border on checked state * fix: clean up styles in RequiresConfirmationController, Checkbox, and Radio components to enhance consistency * fix: update button and filter component styles to remove unnecessary rounded classes for consistency * fix: calendar * fix: update KBarSearch * fix: refine styles in Empty and Checkbox components for improved consistency * Fix focus state email input * fix: update button hover and active states to use 'not-disabled' instead of 'enabled' * fix: line-height issues * fix: update class name for muted background in BookingListItem component * fix: sidebar spacing * chore: update class names to use new Tailwind CSS color utilities * fix embed * chore: upgrade Tailwind CSS to version 4.1.16 and update related dependencies * Map css variables and add a playground test for heavy css customization * suggestion for coss-ui * refactor: update CSS variable usage and clean up styles - Replace instances of `--cal-brand-color` with `--cal-brand` in embed-related HTML files. - Remove the now-unnecessary `addAppCssVars` function from the embed core. - Import theme tokens in the embed core styles for better consistency. - Clean up whitespace and formatting in CSS files for improved readability. - Add a comment in `tokens.css` regarding its usage in both embed and webapp contexts. * Handle within tokens.css instead of fixing coss-ui * Remove initial, not needed. Also, remove tailwind.config.js as tailwidn scans the html automaically * fix: examples app breaking * fix: modal not resizing correctly * feat: upgrade atoms to tailwind v4 * fix: atoms build breaking * fix: atoms build breaking * chore: upgrate examples/base to tailwind 4 * chore: update globals.css * fix: add missing scheduler css variables * fix: PlatformAdditionalCalendarSelector * chore: update global styles * chore: update tailwindcss and postcss dependencies to stable versions * chore: remove unneeded class * fix: dialog and toast animation * fix: replace flex-shrink-0 with shrink-0 for consistent styling in various components * fix: dialog modal for Apple connect * add margin in SaveFilterSegmentButton * Fix radix button nested states * add cursor pointer to buttons but keep dsabled state * Fix commandK selectors and adds cursor pointer * Fix teams filter * fix - round checkboxes * fix filter checkbox * fix select indicator's margin * command group font size * style: fix badge and tooltip radius * chore: remove unneeded files * Delete PR_REVIEW_MANAGED_EVENT_REASSIGNMENT.md * remove ui-playground leftover * fix: add missing react phone input styles in atoms * Delete managed-event-reassignment-flow-and-architecture.mermaid * fix: inter font not loading * Add theme to skeleton container so that it can support dark mode * fix: create custom stack-y-* utilities post tw4 upgrade * fix: typo * fix: atoms stack class + remove unused css file * fix default radius valiue * fix space-y in embed * fix skeleton background * Hardcode radius values to match production * fix border in embed * add missing externalThemeClass * feat: create a custom stack-y-* utility * fix: add stack utility to atom global css * fix: Skeleton loader class modalbox * Add stack-y utility in embed * fix: add missing stack utilities in atoms globals.css * update yarn.lock * add popover portla * update --------- Co-authored-by: Sean Brydon <sean@cal.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: Ryukemeister <sahalrajiv6900@gmail.com> Co-authored-by: cal.com <morgan@cal.com> Co-authored-by: Eunjae Lee <hey@eunjae.dev> Co-authored-by: Anik Dhabal Babu <adhabal2002@gmail.com>
embed-core
This is the vanilla JS core script that embeds Cal Link.
How to use embed on any webpage no matter what framework
See https://developer.cal.com/embed/install-with-javascript
You can also see various example usages here
Development
Run the following command and then you can test the embed in the automatically opened page http://localhost:3100/embed/
We have another html page to specifically test prerendering when using headless router in Demo http://localhost:3100/embed/routing-playground.html
yarn dev
Running Tests
Ensure that the main App is running on port 3000 (e.g. yarn dx) already. Also ensure dev server for embed-core is running and then run the following command: Start the server on 3100 port
yarn dev
And from another terminal you can run the following command to execute tests:
yarn embed-tests-quick
Note: getEmbedIframe and addEmbedListeners work as a team but they only support opening up embed in a fresh load. Opening an embed closing it and then opening another embed isn't supported yet.
Shipping to Production
yarn build
Make dist/embed.umd.js servable on URL http://cal.com/embed.js
DX
- Hot reload doesn't work with CSS files in the way we use vite.
Steps to make a page compatible with Embed
- Define
mainclass on the element that has the entire content of the page with no auto margins- Adding
mainclass allows iframe height to adjust according to it, making sure that the content withinmainis visible without scrolling as long as device dimensions permit it. - It also becomes the area beyond which if the user clicks, modal-box would close.
- Adding
Known Bugs and Upcoming Improvements
-
Unsupported Browsers and versions. Documenting them and gracefully handling that.
-
Need to create a booking Shell so that common changes for embed can be applied there.
-
Accessibility and UI/UX Issues let the user choose the loader for ModalBox If the website owner links the booking page directly for an event, should the user be able to go to events-listing page using back button ? Let the user specify both dark and light theme colors. Right now the colors specified are for light theme.
- Transparent support is not properly done for team links
- Maybe don't set border-radius in inline mode or give an option to configure border-radius.
-
Branding
- Powered by Cal.com and 'Try it for free'. Should they be shown only for FREE account.
- Branding at the bottom has been removed for UI improvements, need to see where to add it.
-
API
- Allow loader color customization using UI command itself too. Right now it's possible using CSS only.
-
Automation Tests
- Run automation tests in CI
- Automation Tests are using snapshots of Booking Page which has current month which requires us to regenerate snapshots every month.
-
Bundling Related
- Comments in CSS aren't stripped off
-
Debuggability
- Send log messages from iframe to parent so that all logs can exist in a single queue forming a timeline.
- user should be able to use "on" instruction to understand what's going on in the system
- Error Tracking for embed.js
- Know where exactly it’s failing if it does.
- Send log messages from iframe to parent so that all logs can exist in a single queue forming a timeline.
-
Color Scheme
- Need to reduce the number of colors on booking page, so that UI configuration is simpler
-
Dev Experience/Ease of Installation
- Do we need a one liner(like
window.dataLayer.push) to inform SDK of something even if snippet is not yet on the page but would be there e.g. through GTM it would come late on the page ?
- Do we need a one liner(like
-
Option to disable redirect banner and let parent handle redirect.
-
Release Issues
- Compatibility Issue - When embed-iframe.js is updated in such a way that it is not compatible with embed.js, doing a release might break the embed for some time. e.g. iframeReady event let's say gets changed to something else
- Best Case scenario - App and Website goes live at the same time. A website using embed loads the same updated and thus compatible versions of embed.js and embed-iframe.js
- Worst case scenario - App goes live first, website PR isn't merged yet and thus a website using the embed would load updated version of embed-iframe but outdated version of embed.js possibly breaking the embed.
- Ideal Solution: It would be to keep the libraries versioned and embed.js should instruct app within iframe to load a particular version. But if we push a security fix, it is possible that someone is still enforcing embed to load version with security issue. Need to handle this.
- Quick Solution: Serve embed.js also from app, so that they go live together and there is only a slight chance of compatibility issues on going live. Note, that they can still occur as 2 different requests are sent at different times to fetch the libraries and deployments can go live in between,
- Compatibility Issue - When embed-iframe.js is updated in such a way that it is not compatible with embed.js, doing a release might break the embed for some time. e.g. iframeReady event let's say gets changed to something else
-
UI Config Features
- How would the user add on hover styles just using style attribute ?
-
If just iframe refreshes due to some reason, embed script can't replay the applied instructions.
-
React Component
onClicksupport with automatic preloading
-
Shadow DOM is currently in open state, which probably means that any styling change on website can impact loader.
Pending Documentation
-
READMEs
- How to make a new element configurable using UI instruction ?
- Why do we NOT want to provide completely flexible CSS customization by adding whatever CSS user wants. ?
- Feature Documentation
- Inline mode doesn't cause any scroll in iframe by default. It looks like it is part of the website.
-
cal.com/docs
- A complete document on how to use embed
-
app.cal.com
- Get Embed code for each event-type