- Changed: Classes that do not implement the Singleton pattern now have
protected
constructor and can be extended. (#1735)
- Fixed: The User-Agent style shet now sets
<select>
elements todisplay: inline-block
, matching rendering recommendations. (#1699)
- Changed: Alfa packages are now (also) published on the npmjs registry. (
5b924adf304b6f809f4c8b9d5a2f4a8950d5b10b
)
- Changed: Dummy minor version to experiment with publish flow, use the previous or next minor version instead. (
2a62d8a43e294ee56c18315c8fad29fbdc18c0df
)
- Changed: Trying to fix a problem in generating provenance statements (#1674)
- Added: Trying to publish Alfa packages on the npm registry (#1673)
-
Fixed: The publish flow was updated to a new version. (
a2f19cf9a6c7c72b8bf085597e4f1a95ac3e4eb2
)Some 0.87.* versions were generating uninstallable package. This should be fixed now.
-
Breaking: TS resolution has been changed to
Node16
, target toes2022
. (#1636) -
Breaking: Alfa is now distributed as ESM rather than CJS modules; projects using it must be ESM or use dynamic
import()
. (#1636)⚠️ This is the last of a series of changes on the internal structure and build process of distributed packages that was started with v0.85.0.
-
Breaking: The .js files are now built in the
dist
folder rather than insrc
. (#1628)⚠️ This is the first of a series of changes on the internal structure and build process of distributed packages. It is probably better to not use this version and wait until more of these internal changes have been done to jump directly to the final result. We are internally releasing these changes for validation purpose only.This should not impact consumers, the
package.json
files should be set correctly to consume these files.
- Breaking: Node 18 is no longer supported. (#1618)
- Added: Each package now contains its internal dependency graph in its
docs
directory. (#1610)
- Added: CSS
import
rules now supportlayer
, andsupports
condition. (#1603)
-
Fixed:
!important
declarations in rules with normal declarations are not dropped anymore. (#1585)While moving handling of
!important
fromalfa-style
toalfa-cascade
, a regression was introduced that effectively dropped!important
declarations from rules having both normal and important ones (e.g.div {color: blue; background: red !important }
); this is now fixed. -
Added: An
isImportant
predicate is available onOrigin
andPrecedence
. (#1585)
- Added: CSS
@layer
rules are now handled when building cascades. (#1574)
- Fixed:
::slotted
selectors within a compound selector are now correctly handled. (#1575)
-
Added:
Cascade
now handles declarations from encapsulated contexts (shadow DOM). (#1553)CSS selectors and rules that are affecting the host tree are now stored separately and retrieved when computing the cascade of said host.
As with other rules from style sheets, these are only effective when the shadow host is part of a document tree. Otherwise, only the
style
attribute is taken into consideration. -
Added: Cascade now handle importance of declarations, and
style
attribute. (#1550)This should have no impact on regular usage of
Style.from()
but may affect code trying to use the cascade directly. Most notably, the internal rule treeBlock
can now come either from a rule or an element. Therefore,Block.rule
andBlock.selector
may now benull
. -
Added: The
:host
and:host-context
pseudo-classes, as well as the::slotted
pseudo-element are now supported. (#1554)
-
Breaking:
SelectorMap.#get
now requires anAncestorFilter
rather than anOption<AncestorFilter>
. (#1540)All actual use cases in the code are now passing an ancestor filter, so there is no need to wrap it as an option anymore.
-
Breaking:
Cascade.of
has been renamedCascade.from
. (#1540)This matches better naming conventions in other packages, since it does perform some heavy computation before building the cascade.
-
Removed:
AncestorFilter#match
has been made internal. (#1540)Use
!AncestorFilter.canReject
instead, which is having fewer assumptions. -
Breaking: Data in Rule tree nodes is now wrapped in a
Block
object that need to be opened. (#1540)That is, replace, e.g.,
node.declarations
withnode.block.declarations
to access the declarations associated to a node in the rule tree, and so forth for other data. -
Added: Functionalities for dealing with Cascade Sorting Order (origin, specificity, order) are now grouped in a
Precedence
interface. (#1540) -
Added: Simple feature query (
@supports
rules) are now supported. (#1544)Only the property testing is implemented (
@supports (foo: bar)
), not the function notations. Properties are considered supported if they do not start with"-"
(i.e. they do not have a vendor prefix).Support feature testing is grouped int he
Feature.Supports
namespace.
-
Breaking:
RuleTree.add
andRuleTree.Node.add
have been made internal. (#1534)These have heavy assumptions on arguments in order to build a correct rule tree and are not intended for external use. Use
Cascade.of
to build correct cascade and rule trees.In addition,
RuleTree.Node.add
has been moved to an instance method, and its arguments have been simplified. -
Breaking:
Cascade.get()
now returns aRuleTree.Node
instead of anOption
. (#1534)RuleTree
now have a fake root with no declarations, if no rule matches the current element,Cascade.get(element)
will return that fake root.
-
Changed:
<button>
'sbackground-color
now defaults tobuttonface
. (#1472)<button>
elements defaultbackground-color
is somewhat different between user-agents. Rather than picking one, we use the systembuttonface
color instead. This notably opens way to handle it with a branched value, possibly also detecting whether we are in forced colors mode.
- Removed: Many pieces of code are no longer exported. These were mostly internal exports that are no longer used in other files and should not impact intended usage of the packages. (#1437)